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

Running failed #13

Closed
Floryndas opened this issue Nov 28, 2018 · 9 comments
Closed

Running failed #13

Floryndas opened this issue Nov 28, 2018 · 9 comments

Comments

@Floryndas
Copy link

Dear,
This is what I have when running the rmlmapper-java:
C:\Users\Justine\git\rmlmapper-java\target>java -jar rmlmapper-4.2.0-r66.jar -m GetAllFDESShortData.xml -o output.ttl -v
Looking for file GetAllFDESShortData.xml in basePath C:\Users\Justine\git\rmlmapper-java\target
Registered service class org.eclipse.rdf4j.rio.datatypes.XMLSchemaDatatypeHandler
Registered service class org.eclipse.rdf4j.rio.datatypes.RDFDatatypeHandler
Registered service class org.eclipse.rdf4j.rio.datatypes.DBPediaDatatypeHandler
Registered service class org.eclipse.rdf4j.rio.datatypes.VirtuosoGeometryDatatypeHandler
Registered service class org.eclipse.rdf4j.rio.datatypes.GeoSPARQLDatatypeHandler
Registered service class org.eclipse.rdf4j.rio.languages.RFC3066LanguageHandler
Registered service class org.eclipse.rdf4j.rio.languages.BCP47LanguageHandler
Reading from C:\Users\Justine\git\rmlmapper-java\target\GetAllFDESShortData.xml
Registered service class org.eclipse.rdf4j.rio.binary.BinaryRDFParserFactory
Registered service class org.eclipse.rdf4j.rio.jsonld.JSONLDParserFactory
Registered service class org.eclipse.rdf4j.rio.n3.N3ParserFactory
Registered service class org.eclipse.rdf4j.rio.nquads.NQuadsParserFactory
Registered service class org.eclipse.rdf4j.rio.ntriples.NTriplesParserFactory
Registered service class org.eclipse.rdf4j.rio.rdfjson.RDFJSONParserFactory
Registered service class org.eclipse.rdf4j.rio.rdfxml.RDFXMLParserFactory
Registered service class org.eclipse.rdf4j.rio.trig.TriGParserFactory
Registered service class org.eclipse.rdf4j.rio.trix.TriXParserFactory
Registered service class org.eclipse.rdf4j.rio.turtle.TurtleParserFactory
org.eclipse.rdf4j.rio.RDFParseException: IRI included an unencoded space: '32' [line 1]
at org.eclipse.rdf4j.rio.helpers.RDFParserHelper.reportError(RDFParserHelper.java:322)
at org.eclipse.rdf4j.rio.helpers.AbstractRDFParser.reportError(AbstractRDFParser.java:684)
at org.eclipse.rdf4j.rio.turtle.TurtleParser.reportError(TurtleParser.java:1309)
at org.eclipse.rdf4j.rio.turtle.TurtleParser.parseURI(TurtleParser.java:900)
at org.eclipse.rdf4j.rio.turtle.TurtleParser.parseValue(TurtleParser.java:588)
at org.eclipse.rdf4j.rio.turtle.TurtleParser.parseSubject(TurtleParser.java:429)
at org.eclipse.rdf4j.rio.turtle.TurtleParser.parseTriples(TurtleParser.java:370)
at org.eclipse.rdf4j.rio.turtle.TurtleParser.parseStatement(TurtleParser.java:239)
at org.eclipse.rdf4j.rio.turtle.TurtleParser.parse(TurtleParser.java:201)
at org.eclipse.rdf4j.rio.turtle.TurtleParser.parse(TurtleParser.java:143)
at org.eclipse.rdf4j.rio.Rio.parse(Rio.java:298)
at be.ugent.rml.Utils.readTurtle(Utils.java:244)
at be.ugent.rml.Utils.readTurtle(Utils.java:253)
at be.ugent.rml.cli.Main.main(Main.java:126)
Looking for file functions.ttl in basePath C:\Users\Justine\git\rmlmapper-java\target
Reading from C:\Users\Justine\AppData\Local\Temp\file9057145616842695711temp.ttl
Exception in thread "main" java.lang.NullPointerException
at be.ugent.rml.store.RDF4JStore.getQuads(RDF4JStore.java:70)
at be.ugent.rml.Initializer.getAllTriplesMaps(Initializer.java:44)
at be.ugent.rml.Initializer.(Initializer.java:24)
at be.ugent.rml.Executor.(Executor.java:47)
at be.ugent.rml.cli.Main.main(Main.java:186)

How can I correct it, please? Have I missed something?
Thanks for your reply.

@pheyvaer
Copy link
Collaborator

Hi @Floryndas,

Could you provide us with the files that you are using? Both the data files and the RML rules.

@Floryndas
Copy link
Author

What are RML rules and how should I get it, please? I do not use any of them

@Floryndas
Copy link
Author

Floryndas commented Nov 29, 2018

Using an example available here: http://rml.io/spec.html#example-XML, I have the following issue:
_C:\Users\Justine\git\rmlmapper-java\Check>java -jar rmlmapper-4.1.0-r53-jar-with-dependencies.jar -m transport.ml.ttl -o output.ttl -v 09:01:29.780 [main] DEBUG be.ugent.rml.Utils .getFile(111) - Looking for file transport.ml.ttl in basePath C:\Users\Justine\git\rmlmapper-java\Check 09:01:29.796 [main] DEBUG o.e.r.rio.DatatypeHandlerRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.datatypes.XMLSchemaDatatypeHandler 09:01:29.798 [main] DEBUG o.e.r.rio.DatatypeHandlerRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.datatypes.RDFDatatypeHandler 09:01:29.799 [main] DEBUG o.e.r.rio.DatatypeHandlerRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.datatypes.DBPediaDatatypeHandler 09:01:29.799 [main] DEBUG o.e.r.rio.DatatypeHandlerRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.datatypes.VirtuosoGeometryDatatypeHandler 09:01:29.800 [main] DEBUG o.e.r.rio.DatatypeHandlerRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.datatypes.GeoSPARQLDatatypeHandler 09:01:29.803 [main] DEBUG o.e.r.rio.LanguageHandlerRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.languages.RFC3066LanguageHandler 09:01:29.804 [main] DEBUG o.e.r.rio.LanguageHandlerRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.languages.BCP47LanguageHandler 09:01:29.805 [main] DEBUG be.ugent.rml.Utils .readTurtle(238) - Reading from C:\Users\Justine\git\rmlmapper-java\Check\transport.ml.ttl 09:01:29.807 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.binary.BinaryRDFParserFactory 09:01:29.807 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.jsonld.JSONLDParserFactory 09:01:29.812 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.n3.N3ParserFactory 09:01:29.812 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.nquads.NQuadsParserFactory 09:01:29.813 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.ntriples.NTriplesParserFactory 09:01:29.814 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.rdfjson.RDFJSONParserFactory 09:01:29.816 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.rdfxml.RDFXMLParserFactory 09:01:29.817 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.trig.TriGParserFactory 09:01:29.817 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.trix.TriXParserFactory 09:01:29.818 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.turtle.TurtleParserFactory 09:01:30.062 [main] DEBUG be.ugent.rml.Utils .getFile(111) - Looking for file functions.ttl in basePath C:\Users\Justine\git\rmlmapper-java\Check 09:01:30.075 [main] DEBUG be.ugent.rml.Utils .readTurtle(238) - Reading from C:\Users\Justine\AppData\Local\Temp\file3364662110127854158temp.ttl Exception in thread "main" java.lang.Error: No Triples Maps found. The mapping document you should at least have one Triples Map. at be.ugent.rml.Initializer.getAllTriplesMaps(Initializer.java:58) at be.ugent.rml.Initializer.<init>(Initializer.java:24) at be.ugent.rml.Executor.<init>(Executor.java:47) at be.ugent.rml.cli.Main.main(Main.java:186)

Here is the Transport.xml file: , which is also available here: https://www.dropbox.com/s/y8d4qgtu706qxql/Transport.xml?dl=0

<transport> <bus id="25" type="SingeDecker"> <route> <stop id="645"> Airport </stop> <stop id="651"> Conference center </stop> </route> <aircondition> false </aircondition> </bus> <bus id="47" type="DoubleDecker"> <route> <stop id="873"> Central Park </stop> <stop id="651"> Conference center </stop> </route> <aircondition> true </aircondition> </bus> </transport>

Here is the mapping file Transport.rml.ttl:
`@prefix rr: https://www.w3.org/ns/r2rml#.
@Prefix rml: https://semweb.mmlab.be/ns/rml#.
@Prefix ex: https://example.com/ns#.
@Prefix ql: https://semweb.mmlab.be/ns/ql#.
@Prefix transit: https://vocab.org/transit/terms/.
@Prefix xsd: https://www.w3.org/2001/XMLSchema#.
@Prefix rdfs: https://www.w3.org/2000/01/rdf-schema#.

ex:TransportMapping
rml:logicalSource [
rml:source "https://www.dropbox.com/s/y8d4qgtu706qxql/Transport.xml?dl=0" ;
rml:iterator "/transport/bus";
rml:referenceFormulation ql:XPath;
];

rr:subjectMap [
rr:template "https://trans.example.com/{/transport/bus@id}";
rr:class transit:Stop
];

rr:predicateObjectMap [
rr:predicate transit:stop;
rr:objectMap [
rml:reference "/transport/bus/route/stop@id";
rr:datatype xsd:int
]
];

rr:predicateObjectMap [
rr:predicate rdfs:label;
rr:objectMap [
rml:reference "/transport/bus/route/stop"
]
].

`

@pheyvaer
Copy link
Collaborator

pheyvaer commented Dec 4, 2018

Hi @Floryndas I had a look and I was able to run the mapping with the following changes:

  • The namespaces (@prefix) you use are in most cases with http instead of https. For example, the namespace for rml is http://semweb.mmlab.be/ns/rml# and not https://semweb.mmlab.be/ns/rml#.
  • Make sure that you add the class to a Triples Map, i.e., ex:TransportMapping a rr:TriplesMap.
  • The link to the Dropbox file does not go to the file directly. It actually goes to a HTML page that has the file embedded. You can either provide the local path of the file or provide a direct link to the file.

Hope this helps.

@Floryndas
Copy link
Author

Hello @pheyvaer , in fact it helps; thank you for that. But I still have errors and I am not able to perform the mapping. Which instruction do you use for the mapping, please?
I type this java -jar rmlmapper-4.1.0-r53-jar-with-dependencies.jar -m transport.ml.ttl -o output.ttl -v and here is the result:
10:16:32.851 [main] DEBUG be.ugent.rml.Utils .getFile(111) - Looking for file transport.ml.ttl in basePath C:\Users\Justine\git\rmlmapper-java\Check 10:16:32.867 [main] DEBUG o.e.r.rio.DatatypeHandlerRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.datatypes.XMLSchemaDatatypeHandler 10:16:32.867 [main] DEBUG o.e.r.rio.DatatypeHandlerRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.datatypes.RDFDatatypeHandler 10:16:32.867 [main] DEBUG o.e.r.rio.DatatypeHandlerRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.datatypes.DBPediaDatatypeHandler 10:16:32.867 [main] DEBUG o.e.r.rio.DatatypeHandlerRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.datatypes.VirtuosoGeometryDatatypeHandler 10:16:32.867 [main] DEBUG o.e.r.rio.DatatypeHandlerRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.datatypes.GeoSPARQLDatatypeHandler 10:16:32.867 [main] DEBUG o.e.r.rio.LanguageHandlerRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.languages.RFC3066LanguageHandler 10:16:32.867 [main] DEBUG o.e.r.rio.LanguageHandlerRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.languages.BCP47LanguageHandler 10:16:32.867 [main] DEBUG be.ugent.rml.Utils .readTurtle(238) - Reading from C:\Users\Justine\git\rmlmapper-java\Check\transport.ml.ttl 10:16:32.883 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.binary.BinaryRDFParserFactory 10:16:32.883 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.jsonld.JSONLDParserFactory 10:16:32.883 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.n3.N3ParserFactory 10:16:32.883 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.nquads.NQuadsParserFactory 10:16:32.883 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.ntriples.NTriplesParserFactory 10:16:32.883 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.rdfjson.RDFJSONParserFactory 10:16:32.883 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.rdfxml.RDFXMLParserFactory 10:16:32.883 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.trig.TriGParserFactory 10:16:32.883 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.trix.TriXParserFactory 10:16:32.883 [main] DEBUG o.e.rdf4j.rio.RDFParserRegistry .<init>(52) - Registered service class org.eclipse.rdf4j.rio.turtle.TurtleParserFactory 10:16:33.114 [main] DEBUG be.ugent.rml.Utils .getFile(111) - Looking for file functions.ttl in basePath C:\Users\Justine\git\rmlmapper-java\Check 10:16:33.121 [main] DEBUG be.ugent.rml.Utils .readTurtle(238) - Reading from C:\Users\Justine\AppData\Local\Temp\file6497197175999447812temp.ttl Exception in thread "main" java.lang.Error: <http://example.com/ns#TransportMapping> has no Subject Map. Each Triples Map should have exactly one Subject Map. at be.ugent.rml.MappingFactory.parseSubjectMap(MappingFactory.java:108) at be.ugent.rml.MappingFactory.createMapping(MappingFactory.java:46) at be.ugent.rml.Initializer.extractMappings(Initializer.java:39) at be.ugent.rml.Initializer.<init>(Initializer.java:34) at be.ugent.rml.Executor.<init>(Executor.java:47) at be.ugent.rml.cli.Main.main(Main.java:186)

I don't really understand what are the updates to perform for it to work for you.
Could you help, please? For example, by showing me your mapping file and the instruction you type in the command line.

@pheyvaer
Copy link
Collaborator

pheyvaer commented Dec 4, 2018

You can find the input file and the mapping that work for me here and I execute the following command java -jar rml-mapper.jar -m mapping.rml.ttl.

@Floryndas
Copy link
Author

Floryndas commented Dec 4, 2018

I have got a result now. It is fine. Thanks for your tips. Actually, I was expected "bus" as an OWL class in generated data; but I did not see it. Only "Stop" exists as an OWL class.
I am working on translation XML data (about 800 elements) into RDF graphs. Can have access to the academic license of RMLEditor so that I can create the mapping file with?
Thanks

@pheyvaer
Copy link
Collaborator

pheyvaer commented Dec 4, 2018

You can change the class if that is needed. Or add another Triples Map that annotates the data with a "bus".

Yes, could you send me an email at pheyvaer.heyvaert@ugent.be?

@no-response
Copy link

no-response bot commented Sep 6, 2019

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@no-response no-response bot closed this as completed Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants