EIS-Bonn / Squerall

An implementation of the so-called Semantic Data Lake, using Apache Spark and Presto.
https://eis-bonn.github.io/Squerall/
Apache License 2.0
30 stars 12 forks source link

Exception in rml:referenceFormulation ql:CSV #8

Open jatoledo opened 4 years ago

jatoledo commented 4 years ago

Hi, In RML, the logical source descriptions from CSV is: rml:referenceFormulation ql:CSV

but this generates an Exception.

<#PersonMapping>
        rml:logicalSource [
                rml:source "/home/jtoledo/Desktop/BSBM/bsbmtools-0.2/dataset/45k/person.csv";
                rml:referenceFormulation ql:CSV
        ];
        rr:subjectMap [
                rr:template "http://example.com/{nr}";
                rr:class foaf:Person
        ];

Exception:

2020-06-22 20:01:37 INFO  Squerall:86 - ---> MAPPING CONSULTATION
2020-06-22 20:01:37 INFO  Squerall:51 - - Going to find datasources relevant to ?x...
2020-06-22 20:01:37 INFO  Squerall:100 - ...with the (Predicate,Object) pairs: Set((<http://xmlns.com/foaf/0.1/mbox_sha1sum>,?mbox), (<http://xmlns.com/foaf/0.1/name>,?name))
2020-06-22 20:01:37 INFO  Squerall:131 - ...for this, the following query will be executed: PREFIX rml: <http://semweb.mmlab.be/ns/rml#>PREFIX rr: <http://www.w3.org/ns/r2rml#>PREFIX foaf: <http://xmlns.com/foaf/spec/>PREFIX nosql: <http://purl.org/db/nosql#>SELECT distinct ?src ?type WHERE {?mp rml:logicalSource ?ls . ?ls rml:source ?src . ?ls nosql:store ?type . ?mp rr:predicateObjectMap ?pom0 . ?pom0 rr:predicate <http://xmlns.com/foaf/0.1/mbox_sha1sum> . ?pom0 rr:objectMap ?om0 . ?mp rr:predicateObjectMap ?pom1 . ?pom1 rr:predicate <http://xmlns.com/foaf/0.1/name> . ?pom1 rr:objectMap ?om1 . } on /home/jtoledo/Documents/github2/Squerall/target/mappings.ttl
2020-06-22 20:01:37 ERROR riot:101 - [line: 20, col: 42] Undefined prefix: ql
Exception in thread "main" org.apache.jena.riot.RiotException: [line: 20, col: 42] Undefined prefix: ql
        at org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.fatal(ErrorHandlerFactory.java:147)
        at org.apache.jena.riot.system.ParserProfileStd.expandPrefixedName(ParserProfileStd.java:276)
        at org.apache.jena.riot.system.ParserProfileStd.create(ParserProfileStd.java:215)
        at org.apache.jena.riot.lang.LangTurtleBase.tokenAsNode(LangTurtleBase.java:498)
        at org.apache.jena.riot.lang.LangTurtleBase.node(LangTurtleBase.java:343)
mnmami commented 4 years ago

Hi @jatoledo,

Judging from the error message: Undefined prefix: ql, it looks like you don't have the prefix ql defined in your mappings: `

@prefix ql: <http://semweb.mmlab.be/ns/ql#>

However, please note that the property rml:referenceFormulation isn't used by Squerall, even if it present in your mappings. Rather, we use another property to instruct what type of source the mapped entity is from nosql:store. See and try to reuse the example here: https://github.com/EIS-Bonn/Squerall/blob/master/evaluation/input_files/mappings.ttl#L134.

Try and let me know.

PS: We are aware that CSV isn't a NoSQL store to be used with that property; we will correct that in the future.

jatoledo commented 4 years ago

Thank you very much for your quick reply, I will try it with the example.

mnmami commented 4 years ago

You are welcome. Don't hesitate to come back in case of errors.

jatoledo commented 4 years ago

In my opinion, the engine should follow RML properties and try to not include new ones because in that way we start to lose the benefits of having a standard and declarative way to describe the mapping rules. ;-)