isl / x3ml

X3ML Engine supports the data transformation which is part of the data provisioning and aggregation process.
Apache License 2.0
19 stars 7 forks source link

Strange error messages are thrown when there are unbound resources #119

Closed ymark closed 6 years ago

ymark commented 6 years ago

When we use resources defined as types or relationships (see below) that are not bound to a specific namespace then some strange messages are thrown. Some indicative unbound resources are the following:

:E22_Man-Made_Object

or

:P1_is_identified_by

Furthermore it seems that the error messages are different if the info block exists.

If the info block is missing then the error message is:

ERROR Utils:122 - The namespace with prefix "" has not been declared

If the info block exists then the error message is:

Exception in thread "main" com.hp.hpl.jena.shared.BadURIException: Only well-formed absolute URIrefs can be included in RDF/XML output:  Code: 57/REQUIRED_COMPONENT_MISSING in SCHEME: A component that is required by the scheme is missing.
    at com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.checkURI(BaseXMLWriter.java:836)
    at com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.xmlnsDecl(BaseXMLWriter.java:351)
    at com.hp.hpl.jena.xmloutput.impl.Unparser.printNameSpaceDefn(Unparser.java:1075)
    at com.hp.hpl.jena.xmloutput.impl.Unparser.wRDF(Unparser.java:338)
    at com.hp.hpl.jena.xmloutput.impl.Unparser.write(Unparser.java:247)
    at com.hp.hpl.jena.xmloutput.impl.Abbreviated.writeBody(Abbreviated.java:142)
    at com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.writeXMLBody(BaseXMLWriter.java:503)
    at com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:475)
    at com.hp.hpl.jena.xmloutput.impl.Abbreviated.write(Abbreviated.java:127)
    at com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:462)
    at com.hp.hpl.jena.rdf.model.impl.ModelCom.write(ModelCom.java:345)
    at eu.delving.x3ml.engine.ModelOutput.writeXML(ModelOutput.java:125)
    at gr.forth.ics.isl.example.Example.main(Example.java:72)

The X3ML mappings file for reproducing the issue are attached. mappings.x3ml.txt

ymark commented 6 years ago

The issue has been resolved by validating the values of types and relationships. The following comparisons are now supported:

Unqualified tag: 'E41_Appellation'. The namespace of the resource is missing

The updated error messages hanldling will appear from version 1.8.5