Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why the output not included prefixes #12

Open
Amrosx opened this issue May 26, 2021 · 1 comment
Open

why the output not included prefixes #12

Amrosx opened this issue May 26, 2021 · 1 comment
Assignees

Comments

@Amrosx
Copy link

Amrosx commented May 26, 2021

this is the body

{ "rml": "@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 ql: <http://semweb.mmlab.be/ns/ql#>. @prefix map: <http://mapping.example.com/>. map:map_person_0 rml:logicalSource map:source_0; a rr:TriplesMap; rdfs:label \"person\"; rr:subjectMap map:s_0; rr:predicateObjectMap map:pom_0, map:pom_1. map:om_0 a rr:ObjectMap; rr:constant \"http://xmlns.com/foaf/0.1/Person\"; rr:termType rr:IRI. map:om_1 a rr:ObjectMap; rml:reference \"firstname\"; rr:termType rr:Literal. map:pm_0 a rr:PredicateMap; rr:constant rdf:type. map:pm_1 a rr:PredicateMap; rr:constant <http://example.com/name>. map:pom_0 a rr:PredicateObjectMap; rr:predicateMap map:pm_0; rr:objectMap map:om_0. map:pom_1 a rr:PredicateObjectMap; rr:predicateMap map:pm_1; rr:objectMap map:om_1. map:s_0 a rr:SubjectMap; rr:template \"http://example.com/{firstname}\". map:source_0 a rml:LogicalSource; rml:source \"data.json\"; rml:iterator \"$.persons[*]\"; rml:referenceFormulation ql:JSONPath.", "sources": { "data.json": "{ \"persons\": [ { \"firstname\": \"John\", \"lastname\": \"Doe\" }, { \"firstname\": \"Jane\", \"lastname\": \"Smith\" }, { \"firstname\": \"Sarah\", \"lastname\": \"Bladinck\" } ] }" }, "serialization": "turtle" }

this is the result wihout the prefixes ?? and if you mapp direct from jar file it print out the prefixes.

{ "output": "\n<http://example.com/Jane> a <http://xmlns.com/foaf/0.1/Person>;\n <http://example.com/name> \"Jane\" .\n\n<http://example.com/John> a <http://xmlns.com/foaf/0.1/Person>;\n <http://example.com/name> \"John\" .\n\n<http://example.com/Sarah> a <http://xmlns.com/foaf/0.1/Person>;\n <http://example.com/name> \"Sarah\" .\n" }

@pheyvaer
Copy link
Collaborator

The reason is that the Web API returns the results as N-Quads, while the default for the RMLMapper is Turtle. A new feature has been added to the RMLMapper (and consequently also the Web API) that allows you to set the Target of a mapping. This target allows you also to define what serialization format is used for the output.

@pheyvaer pheyvaer self-assigned this Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants