@@ -41,6 +41,7 @@ public function convert( $uri ) {
4141 $ convStrategies = array (
4242 'getExistingTitleForURI ' ,
4343 'applyGlobalSettingForPropertiesToUseAsWikiTitle ' ,
44+ 'parseBNode ' ,
4445 'shortenURINamespaceToAliasInSourceRDF ' ,
4546 'extractLocalPartFromURI ' ,
4647 'useValueAsIs '
@@ -96,7 +97,23 @@ function applyGlobalSettingForPropertiesToUseAsWikiTitle( $uri ) {
9697 }
9798
9899 /**
99- * Strategy 3: Abbreviate the namespace to its NS prefix as configured in
100+ * Strategy 3: Check if $uri is a blank node, and if so, add 'BNode_' to the wiki title.
101+ * @param $uri
102+ * @return string
103+ */
104+ function parseBNode ( $ uri ) {
105+ $ title = '' ;
106+
107+ if ( substr ( $ uri , 0 , 2 ) == '_: ' ) {
108+ $ bnodeId = explode ( ': ' , $ uri )[1 ];
109+ $ title = 'Blank_node_ ' . substr ( $ bnodeId , 3 );
110+ }
111+
112+ return $ title ;
113+ }
114+
115+ /**
116+ * Strategy 4: Abbreviate the namespace to its NS prefix as configured in
100117 * mappings in the parser (default ones, or provided as part of the
101118 * imported data)
102119 */
@@ -121,7 +138,7 @@ function shortenURINamespaceToAliasInSourceRDF( $uri ) {
121138 }
122139
123140 /**
124- * Strategy 4 : As a default, just try to get the local part of the URL
141+ * Strategy 5 : As a default, just try to get the local part of the URL
125142 */
126143 function extractLocalPartFromURI ( $ uri ) {
127144 $ title = '' ;
@@ -135,7 +152,7 @@ function extractLocalPartFromURI( $uri ) {
135152 }
136153
137154 /**
138- * Strategy 5 : Just use the value as is, as if it was a literal value
155+ * Strategy 6 : Just use the value as is, as if it was a literal value
139156 */
140157 function useValueAsIs ( $ uri ) {
141158 return $ uri ;
0 commit comments