-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from oeg-upm/dev
Adding Functions support!
- Loading branch information
Showing
64 changed files
with
1,270 additions
and
234 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.8.1 | ||
0.8.2 |
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
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
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
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
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,53 @@ | ||
@prefix foaf: <http://xmlns.com/foaf/0.1/>. | ||
@prefix ex: <http://example.com/>. | ||
@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 ql: <http://semweb.mmlab.be/ns/ql#>. | ||
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#>. | ||
@prefix schema: <http://schema.org/>. | ||
@prefix formats: <http://www.w3.org/ns/formats/>. | ||
@prefix comp: <http://semweb.mmlab.be/ns/rml-compression#>. | ||
@prefix void: <http://rdfs.org/ns/void#>. | ||
@prefix fnml: <http://semweb.mmlab.be/ns/fnml#>. | ||
@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#>. | ||
@base <http://example.com/ns#>. | ||
|
||
|
||
<function_student2_0> a fnml:Execution; | ||
fnml:function ex:toLowerCase ; | ||
fnml:input | ||
[ | ||
a fnml:Input; | ||
fnml:parameter ex:input; | ||
fnml:valueMap [ | ||
a fnml:ValueMap; | ||
rml:reference "firstname"; | ||
]; | ||
]. | ||
|
||
<student2_0> a rr:TriplesMap; | ||
|
||
rml:logicalSource [ | ||
a rml:LogicalSource; | ||
rml:source "student.csv"; | ||
rml:referenceFormulation ql:CSV | ||
]; | ||
rr:subjectMap [ | ||
a rr:SubjectMap; | ||
rr:template "http://example.com/{Name}"; | ||
]; | ||
rr:predicateObjectMap [ | ||
rr:predicateMap [ | ||
a rr:PredicateMap; | ||
rr:constant foaf:name; | ||
]; | ||
rml:objectMap [ | ||
a rr:ObjectMap; | ||
fnml:execution <function_student2_0>; | ||
]; | ||
]. | ||
|
||
|
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,15 @@ | ||
prefixes: | ||
foaf: http://xmlns.com/foaf/0.1/ | ||
ex: http://example.com/ | ||
|
||
mappings: | ||
student2: | ||
sources: | ||
- [ 'student.csv~csv' ] | ||
s: http://example.com/$(Name) | ||
po: | ||
- p: foaf:name | ||
o: | ||
- function: ex:toLowerCase | ||
parameters: | ||
- [ ex:input, $(firstname) ] |
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,25 @@ | ||
__author__ = "David Chaves-Fraga" | ||
__credits__ = ["David Chaves-Fraga"] | ||
|
||
__license__ = "Apache-2.0" | ||
__maintainer__ = "David Chaves-Fraga" | ||
__email__ = "david.chaves@upm.es" | ||
|
||
|
||
import os | ||
from ruamel.yaml import YAML | ||
import yarrrml_translator | ||
from rdflib.graph import Graph | ||
from rdflib import compare | ||
|
||
|
||
def test_yarrrmltc0040(): | ||
expected_mapping = Graph() | ||
expected_mapping.parse(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'mapping.ttl'), format="ttl") | ||
|
||
translated_mapping = Graph() | ||
yaml = YAML(typ='safe', pure=True) | ||
mapping_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'mapping.yml') | ||
translated_mapping.parse(data=yarrrml_translator.translate(yaml.load(open(mapping_path))), format="ttl") | ||
|
||
assert compare.isomorphic(expected_mapping, translated_mapping) |
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,51 @@ | ||
@prefix foaf: <http://xmlns.com/foaf/0.1/>. | ||
@prefix ex: <http://example.com/>. | ||
@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 ql: <http://semweb.mmlab.be/ns/ql#>. | ||
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#>. | ||
@prefix schema: <http://schema.org/>. | ||
@prefix formats: <http://www.w3.org/ns/formats/>. | ||
@prefix comp: <http://semweb.mmlab.be/ns/rml-compression#>. | ||
@prefix void: <http://rdfs.org/ns/void#>. | ||
@prefix fnml: <http://semweb.mmlab.be/ns/fnml#>. | ||
@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#>. | ||
@base <http://example.com/ns#>. | ||
|
||
|
||
<function_student2_0> a fnml:Execution; | ||
fnml:function ex:toLowerCase ; | ||
fnml:input | ||
[ | ||
a fnml:Input; | ||
fnml:parameter ex:input; | ||
fnml:valueMap [ | ||
a fnml:ValueMap; | ||
rml:reference "firstname"; | ||
]; | ||
]. | ||
|
||
<student2_0> a rr:TriplesMap; | ||
|
||
rml:logicalSource [ | ||
a rml:LogicalSource; | ||
rml:source "student.csv"; | ||
rml:referenceFormulation ql:CSV | ||
]; | ||
rr:subjectMap [ | ||
a rr:SubjectMap; | ||
fnml:execution <function_student2_0>; | ||
]; | ||
rr:predicateObjectMap [ | ||
rr:predicateMap [ | ||
a rr:PredicateMap; | ||
rr:constant foaf:firstName; | ||
]; | ||
rr:objectMap [ | ||
a rr:ObjectMap; | ||
rml:reference "name"; | ||
]; | ||
]. |
Oops, something went wrong.