Skip to content

Commit

Permalink
Merge pull request #107 from chrdebru/missing-test
Browse files Browse the repository at this point in the history
A test case for selecting values from attributes (XML only)
  • Loading branch information
pmaria authored Mar 5, 2024
2 parents 6ef513a + 0d1b506 commit 6140d51
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test-cases/RMLTC0023a-XML/ious.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>

<persons>
<person fname="Bob" lname="Smith" amount="30.0E0">
</person>
<person fname="Sue" lname="Jones" amount="20.0E0">
</person>
<person fname="Bob" lname="Smith" amount="30.0E0">
</person>
</persons>
17 changes: 17 additions & 0 deletions test-cases/RMLTC0023a-XML/mapping.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@prefix ex: <http://example.com/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rml: <http://w3id.org/rml/> .

<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
rml:logicalSource [ a rml:LogicalSource ;
rml:iterator "/persons/person" ;
rml:referenceFormulation rml:XPath ;
rml:source _:b347486 ] ;
rml:predicateObjectMap [ rml:objectMap [ rml:reference "@amount" ] ;
rml:predicate ex:owes ] ;
rml:subjectMap [ rml:class foaf:Person ;
rml:template "http://example.com/{@fname};{@lname}" ] .

_:b347486 a rml:RelativePathSource ;
rml:path "ious.xml" .

5 changes: 5 additions & 0 deletions test-cases/RMLTC0023a-XML/output.nq
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .

0 comments on commit 6140d51

Please sign in to comment.