Skip to content

Commit

Permalink
Merge pull request #67 from TheRazorace/dev
Browse files Browse the repository at this point in the history
Addition of in-memory YARRRML test cases (dev branch)
  • Loading branch information
dachafra authored Jul 2, 2023
2 parents 8beceeb + c35a8a7 commit 8e46786
Show file tree
Hide file tree
Showing 25 changed files with 1,166 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/rml-in-memory/Description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# In-Memory YARRRML
Syntax proposal test cases for in-memory YARRRML.

IMTC001: Pandas dataframe as source

IMTC002: Pandas dataframe as source without specifying software characteristics

IMTC003: Pandas dataframe as source without specifying software characteristics - short version

IMTC004: Python dictionary as source

IMTC005: Python dictionary as source without specifying software characteristics - short version

IMTC006: Multiple Pandas dataframes as sources

IMTC007: Multiple Python dictionaries as sources

IMTC008: Combination of in-memory and localy stored source
42 changes: 42 additions & 0 deletions test/rml-in-memory/IMTC001/mappings-new.rml.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@prefix insta: <http://instagram.com/data/>.
@prefix rml: <http://w3id.org/rml/>.
@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 sd: <https://w3id.org/okn/o/sd/>.
@prefix kg4di: <https://w3id.org/kg4di/definedBy>.


<df_map> a rml:TriplesMap;

rml:logicalSource [
a rml:LogicalSource;
rml:source [
a sd:DatasetSpecification;
sd:name "output_dataframe";
sd:hasDataTransformation [
sd:hasSoftwareRequirements "pandas>=1.1.0";
sd:hasSourceCode [
sd:programmingLanguage "Python3.9";
];
];
];
rml:referenceFormulation ql:DataFrame;
];
rml:subjectMap [
a rml:SubjectMap;
rml:template "http://instagram.com/data/user{Id}";
];
rml:predicateObjectMap [
rml:predicateMap [
a rml:PredicateMap;
rml:constant rdf:type;
];
rml:objectMap [
a rml:ObjectMap;
rml:constant insta:User;
];
].

ql:DataFrame a rml:ReferenceFormulation;
kg4di:definedBy "Pandas".
43 changes: 43 additions & 0 deletions test/rml-in-memory/IMTC001/mappings.rml.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@prefix insta: <http://instagram.com/data/>.
@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix rml: <http://semweb.mmlab.be/ns/rml#>.
@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 sd: <https://w3id.org/okn/o/sd/>.
@prefix kg4di: <https://w3id.org/kg4di/definedBy>.


<df_map> a rr:TriplesMap;

rml:logicalSource [
a rml:LogicalSource;
rml:source [
a sd:DatasetSpecification;
sd:name "output_dataframe";
sd:hasDataTransformation [
sd:hasSoftwareRequirements "pandas>=1.1.0";
sd:hasSourceCode [
sd:programmingLanguage "Python3.9";
];
];
];
rml:referenceFormulation ql:DataFrame;
];
rr:subjectMap [
a rr:SubjectMap;
rr:template "http://instagram.com/data/user{Id}";
];
rr:predicateObjectMap [
rr:predicateMap [
a rr:PredicateMap;
rr:constant rdf:type;
];
rr:objectMap [
a rr:ObjectMap;
rr:constant insta:User;
];
].

ql:DataFrame a rml:ReferenceFormulation;
kg4di:definedBy "Pandas".
23 changes: 23 additions & 0 deletions test/rml-in-memory/IMTC001/mappings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
prefixes:
insta: "http://instagram.com/data/"
rr: "http://www.w3.org/ns/r2rml#"
rml: "http://semweb.mmlab.be/ns/rml#"
rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
rdfs: "http://www.w3.org/2000/01/rdf-schema#"
xsd: "http://www.w3.org/2001/XMLSchema#"
foaf: "http://xmlns.com/foaf/0.1/"
sd: "https://w3id.org/okn/o/sd/"
kg4di: "https://w3id.org/kg4di/"

mappings:
df_map:
sources:
access: $(output_dataframe)
referenceFormulation: DataFrame
structureDefiner: Pandas
softwareSpecification:
programmingLanguage: Python3.9
softwareRequirements: “pandas>=1.1.0”
s: http://instagram.com/data/user{Id}
po:
- [a, insta:User]
36 changes: 36 additions & 0 deletions test/rml-in-memory/IMTC002/mappings-new.rml.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@prefix insta: <http://instagram.com/data/>.
@prefix rml: <http://w3id.org/rml/>.
@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 sd: <https://w3id.org/okn/o/sd/>.
@prefix kg4di: <https://w3id.org/kg4di/definedBy>.


<df_map> a rml:TriplesMap;

rml:logicalSource [
a rml:LogicalSource;
rml:source [
a sd:DatasetSpecification;
sd:name "output_dataframe";
];
rml:referenceFormulation ql:DataFrame;
];
rml:subjectMap [
a rml:SubjectMap;
rml:template "http://instagram.com/data/user{Id}";
];
rml:predicateObjectMap [
rml:predicateMap [
a rml:PredicateMap;
rml:constant rdf:type;
];
rml:objectMap [
a rml:ObjectMap;
rml:constant insta:User;
];
].

ql:DataFrame a rml:ReferenceFormulation;
kg4di:definedBy "Pandas".
37 changes: 37 additions & 0 deletions test/rml-in-memory/IMTC002/mappings.rml.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@prefix insta: <http://instagram.com/data/>.
@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix rml: <http://semweb.mmlab.be/ns/rml#>.
@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 sd: <https://w3id.org/okn/o/sd/>.
@prefix kg4di: <https://w3id.org/kg4di/definedBy>.


<df_map> a rr:TriplesMap;

rml:logicalSource [
a rml:LogicalSource;
rml:source [
a sd:DatasetSpecification;
sd:name "output_dataframe";
];
rml:referenceFormulation ql:DataFrame;
];
rr:subjectMap [
a rr:SubjectMap;
rr:template "http://instagram.com/data/user{Id}";
];
rr:predicateObjectMap [
rr:predicateMap [
a rr:PredicateMap;
rr:constant rdf:type;
];
rr:objectMap [
a rr:ObjectMap;
rr:constant insta:User;
];
].

ql:DataFrame a rml:ReferenceFormulation;
kg4di:definedBy "Pandas".
20 changes: 20 additions & 0 deletions test/rml-in-memory/IMTC002/mappings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
prefixes:
insta: "http://instagram.com/data/"
rr: "http://www.w3.org/ns/r2rml#"
rml: "http://semweb.mmlab.be/ns/rml#"
rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
rdfs: "http://www.w3.org/2000/01/rdf-schema#"
xsd: "http://www.w3.org/2001/XMLSchema#"
foaf: "http://xmlns.com/foaf/0.1/"
sd: "https://w3id.org/okn/o/sd/"
kg4di: "https://w3id.org/kg4di/"

mappings:
df_map:
sources:
access: $(output_dataframe)
referenceFormulation: DataFrame
structureDefiner: Pandas
s: http://instagram.com/data/user{Id}
po:
- [a, insta:User]
36 changes: 36 additions & 0 deletions test/rml-in-memory/IMTC003/mappings-new.rml.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@prefix insta: <http://instagram.com/data/>.
@prefix rml: <http://w3id.org/rml/>.
@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 sd: <https://w3id.org/okn/o/sd/>.
@prefix kg4di: <https://w3id.org/kg4di/definedBy>.


<df_map> a rml:TriplesMap;

rml:logicalSource [
a rml:LogicalSource;
rml:source [
a sd:DatasetSpecification;
sd:name "output_dataframe";
];
rml:referenceFormulation ql:DataFrame;
];
rml:subjectMap [
a rml:SubjectMap;
rml:template "http://instagram.com/data/user{Id}";
];
rml:predicateObjectMap [
rml:predicateMap [
a rml:PredicateMap;
rml:constant rdf:type;
];
rml:objectMap [
a rml:ObjectMap;
rml:constant insta:User;
];
].

ql:DataFrame a rml:ReferenceFormulation;
kg4di:definedBy "Pandas".
37 changes: 37 additions & 0 deletions test/rml-in-memory/IMTC003/mappings.rml.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@prefix insta: <http://instagram.com/data/>.
@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix rml: <http://semweb.mmlab.be/ns/rml#>.
@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 sd: <https://w3id.org/okn/o/sd/>.
@prefix kg4di: <https://w3id.org/kg4di/definedBy>.


<df_map> a rr:TriplesMap;

rml:logicalSource [
a rml:LogicalSource;
rml:source [
a sd:DatasetSpecification;
sd:name "output_dataframe";
];
rml:referenceFormulation ql:DataFrame;
];
rr:subjectMap [
a rr:SubjectMap;
rr:template "http://instagram.com/data/user{Id}";
];
rr:predicateObjectMap [
rr:predicateMap [
a rr:PredicateMap;
rr:constant rdf:type;
];
rr:objectMap [
a rr:ObjectMap;
rr:constant insta:User;
];
].

ql:DataFrame a rml:ReferenceFormulation;
kg4di:definedBy "Pandas".
18 changes: 18 additions & 0 deletions test/rml-in-memory/IMTC003/mappings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
prefixes:
insta: "http://instagram.com/data/"
rr: "http://www.w3.org/ns/r2rml#"
rml: "http://semweb.mmlab.be/ns/rml#"
rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
rdfs: "http://www.w3.org/2000/01/rdf-schema#"
xsd: "http://www.w3.org/2001/XMLSchema#"
foaf: "http://xmlns.com/foaf/0.1/"
sd: "https://w3id.org/okn/o/sd/"
kg4di: "https://w3id.org/kg4di/"

mappings:
df_map:
sources:
- [$(output_dataframe)~Pandas-DataFrame]
s: http://instagram.com/data/user{Id}
po:
- [a, insta:User]
42 changes: 42 additions & 0 deletions test/rml-in-memory/IMTC004/mappings-new.rml.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@prefix insta: <http://instagram.com/data/>.
@prefix rml: <http://w3id.org/rml/>.
@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 sd: <https://w3id.org/okn/o/sd/>.
@prefix kg4di: <https://w3id.org/kg4di/definedBy>.


<dict_map> a rml:TriplesMap;

rml:logicalSource [
a rml:LogicalSource;
rml:source [
a sd:DatasetSpecification;
sd:name "output_dict";
sd:hasDataTransformation [
sd:hasSourceCode [
sd:programmingLanguage "Python3.9";
];
];
];
rml:referenceFormulation ql:Dictionary;
rml:iterator "$.users[*]";
];
rml:subjectMap [
a rml:SubjectMap;
rml:template "http://instagram.com/data/user{id}";
];
rml:predicateObjectMap [
rml:predicateMap [
a rml:PredicateMap;
rml:constant rdf:type;
];
rml:objectMap [
a rml:ObjectMap;
rml:constant insta:User;
];
].

ql:Dictionary a rml:ReferenceFormulation;
kg4di:definedBy "Python".
Loading

0 comments on commit 8e46786

Please sign in to comment.