-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Executor: fix crash when subject has null
XPath expresssions may return null in subjects, do not crash then. Fixes #236
- Loading branch information
1 parent
fd59a3e
commit 144f9b4
Showing
7 changed files
with
128 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0"?> | ||
<railML xmlns="https://www.railml.org/schemas/3.1"> | ||
<netElements> | ||
<netElement id="A" x="1" y="3"> | ||
<name language="NO" name="NODE-1"/> | ||
<relation ref="A_B"/> | ||
</netElement> | ||
<netElement id="B" x="6" y="8"> | ||
<name language="NO" name="NODE-2"/> | ||
<relation ref="A_B"/> | ||
</netElement> | ||
</netElements> | ||
<netRelations> | ||
<netRelation id="A_B"> | ||
<elementA ref="A"/> | ||
<elementB ref="B"/> | ||
</netRelation> | ||
</netRelations> | ||
</railML> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
@prefix owl: <http://www.w3.org/2002/07/owl#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix rr: <http://www.w3.org/ns/r2rml#> . | ||
@prefix rml: <http://semweb.mmlab.be/ns/rml#> . | ||
@prefix ql: <http://semweb.mmlab.be/ns/ql#> . | ||
@prefix ex: <http://data.example.org/resource/> . | ||
@prefix org: <http://www.w3.org/ns/org#> . | ||
@prefix skos: <http://www.w3.org/2004/02/skos/core#> . | ||
@prefix fnml: <http://semweb.mmlab.be/ns/fnml#> . | ||
@prefix fno: <https://w3id.org/function/ontology#> . | ||
@prefix idlab-fn: <http://example.com/idlab/function/> . | ||
|
||
ex:Organizations a rr:TriplesMap; | ||
rml:logicalSource [ | ||
rml:source "test.xml"; | ||
rml:iterator "/Directory/Organization"; | ||
rml:referenceFormulation ql:XPath | ||
]; | ||
rr:subjectMap [ | ||
rr:template "http://data.example.org/resource/Organization_{ID}"; | ||
rr:class org:Organization | ||
]; | ||
rr:predicateObjectMap [ | ||
rr:predicate org:name; | ||
rr:objectMap | ||
[ | ||
rml:reference "Name" | ||
]; | ||
] ; | ||
rr:predicateObjectMap [ | ||
rr:predicate org:address; | ||
rr:objectMap | ||
[ | ||
rr:parentTriplesMap ex:Addresses ; | ||
rr:joinCondition [ | ||
rr:child "path(.)"; | ||
rr:parent "path(..)"; | ||
]; | ||
]; | ||
] | ||
. | ||
|
||
ex:Addresses a rr:TriplesMap; | ||
rml:logicalSource [ | ||
rml:source "test.xml"; | ||
rml:iterator "/Directory/Organization/Address"; | ||
rml:referenceFormulation ql:XPath | ||
]; | ||
rr:subjectMap [ | ||
# rr:template "http://data.example.org/resource/Address_{generate-id(.)}"; | ||
rml:reference "if(exists(StreetName)) then 'http://data.example.org/resource/Address_' || generate-id(.) else null"; | ||
rr:class org:Address | ||
]; | ||
rr:predicateObjectMap [ | ||
rr:predicate org:streetName; | ||
rr:objectMap | ||
[ | ||
rml:reference "StreetName" | ||
]; | ||
] ; | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<http://data.example.org/resource/Address_d0e33> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/org#Address> . | ||
<http://data.example.org/resource/Address_d0e33> <http://www.w3.org/ns/org#streetName> "99 Maine St" . | ||
<http://data.example.org/resource/Address_d0e9> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/org#Address> . | ||
<http://data.example.org/resource/Address_d0e9> <http://www.w3.org/ns/org#streetName> "ABC FastCo Lane" . | ||
<http://data.example.org/resource/Organization_123> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/org#Organization> . | ||
<http://data.example.org/resource/Organization_123> <http://www.w3.org/ns/org#address> <http://data.example.org/resource/Address_d0e9> . | ||
<http://data.example.org/resource/Organization_123> <http://www.w3.org/ns/org#name> "ABC FastCo" . | ||
<http://data.example.org/resource/Organization_456> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/org#Organization> . | ||
<http://data.example.org/resource/Organization_456> <http://www.w3.org/ns/org#name> "XYZ Inc." . | ||
<http://data.example.org/resource/Organization_789> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/org#Organization> . | ||
<http://data.example.org/resource/Organization_789> <http://www.w3.org/ns/org#address> <http://data.example.org/resource/Address_d0e33> . | ||
<http://data.example.org/resource/Organization_789> <http://www.w3.org/ns/org#name> "MNO Ltd" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<Directory> | ||
<Organization> | ||
<ID>123</ID> | ||
<Name>ABC FastCo</Name> | ||
<Address> | ||
<StreetName>ABC FastCo Lane</StreetName> | ||
</Address> | ||
</Organization> | ||
<Organization> | ||
<ID>456</ID> | ||
<Name>XYZ Inc.</Name> | ||
<Address> | ||
<Area>XYZ Metro</Area> | ||
</Address> | ||
</Organization> | ||
<Organization> | ||
<ID>789</ID> | ||
<Name>MNO Ltd</Name> | ||
<Address> | ||
<StreetName>99 Maine St</StreetName> | ||
</Address> | ||
</Organization> | ||
</Directory> |