You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by 锐光刘 <ti...@gmail.com> on 2012/03/21 11:23:42 UTC

Problems during creating RDFS and Consistent Check

My Problems are that I want to  create ontology model  OntModel with the
given namespace and then check it whit pellet reasoner , it show the error
message below:



 WARN [main] (BaseXMLWriter.java:96) - Namespace prefix 'j.2' is reserved
by Jena.
 WARN [main] (BaseXMLWriter.java:96) - Namespace prefix 'j.1' is reserved
by Jena.
 WARN [main] (BaseXMLWriter.java:96) - Namespace prefix 'j.1' is reserved
by Jena.
 WARN [main] (BaseXMLWriter.java:96) - Namespace prefix 'j.2' is reserved
by Jena.
Exception in thread "main" java.lang.NullPointerException
at org.mindswap.pellet.Individual.getRNeighborEdges(Individual.java:680)
at
org.mindswap.pellet.tableau.completion.rule.SomeValuesRule.applySomeValuesRule(SomeValuesRule.java:120)
at
org.mindswap.pellet.tableau.completion.rule.SomeValuesRule.apply(SomeValuesRule.java:64)
at
org.mindswap.pellet.tableau.completion.rule.AbstractTableauRule.apply(AbstractTableauRule.java:64)
at
org.mindswap.pellet.tableau.completion.SROIQStrategy.complete(SROIQStrategy.java:157)
at org.mindswap.pellet.ABox.isConsistent(ABox.java:1416)
at org.mindswap.pellet.ABox.isConsistent(ABox.java:1253)
at org.mindswap.pellet.KnowledgeBase.consistency(KnowledgeBase.java:1989)
at org.mindswap.pellet.KnowledgeBase.isConsistent(KnowledgeBase.java:2063)
at org.mindswap.pellet.jena.PelletInfGraph.prepare(PelletInfGraph.java:263)
at org.mindswap.pellet.jena.PelletInfGraph.prepare(PelletInfGraph.java:246)
at
org.mindswap.pellet.jena.PelletInfGraph.isConsistent(PelletInfGraph.java:274)
at FunctionReasoner.CreateReasoner.checkStrategyOne(CreateReasoner.java:79)
at
FunctionReasoner.CreateReasoner.isConsistentControl(CreateReasoner.java:55)
at FunctionReasoner.CreateReasoner.ConsistentCheck(CreateReasoner.java:48)
at FunctionReasoner.CreateReasoner.<init>(CreateReasoner.java:36)
at FunctionProcess.IntegrateCreate.CreateMainClass(IntegrateCreate.java:45)
at FunctionProcess.IntegrateCreate.getModel(IntegrateCreate.java:35)
at AIndex._4_CreateWithConsistent.main(_4_CreateWithConsistent.java:37)


and another creatation with other information under the same process
routine show the error message below :




Exception in thread "main" com.hp.hpl.jena.shared.BadURIException: Only
well-formed absolute URIrefs can be included in RDF/XML output: <biological
process unknown@en> 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:829)
at
com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.relativize(BaseXMLWriter.java:806)
at
com.hp.hpl.jena.xmloutput.impl.Basic.writeResourceReference(Basic.java:148)
at com.hp.hpl.jena.xmloutput.impl.Basic.writePredicate(Basic.java:101)
at com.hp.hpl.jena.xmloutput.impl.Basic.writeRDFStatements(Basic.java:77)
at com.hp.hpl.jena.xmloutput.impl.Basic.writeRDFStatements(Basic.java:66)
at com.hp.hpl.jena.xmloutput.impl.Basic.writeBody(Basic.java:40)
at
com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.writeXMLBody(BaseXMLWriter.java:500)
at
com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:472)
at
com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:458)
at com.hp.hpl.jena.rdf.model.impl.ModelCom.write(ModelCom.java:271)
at com.hp.hpl.jena.ontology.impl.OntModelImpl.write(OntModelImpl.java:2552)
at FunctionReasoner.CreateReasoner.<init>(CreateReasoner.java:33)
at FunctionProcess.IntegrateCreate.CreateMainClass(IntegrateCreate.java:45)
at FunctionProcess.IntegrateCreate.getModel(IntegrateCreate.java:35)
at AIndex._0_All.main(_0_All.java:82)




Could someone tell me what's the problems , thanks !

Re: Problems during creating RDFS and Consistent Check

Posted by Andy Seaborne <an...@apache.org>.
On 21/03/12 10:23, 锐光刘 wrote:
> My Problems are that I want to  create ontology model  OntModel with the
> given namespace and then check it whit pellet reasoner , it show the error
> message below:
>
>
>
>   WARN [main] (BaseXMLWriter.java:96) - Namespace prefix 'j.2' is reserved
> by Jena.

Don't use prefixes for the form "j.NUMBER" -- Jena needs to be able to 
generate it's own sometimes in such a way that they will not clash even 
with data it has not seen yet.  So it reserves names pace like j.1, j.2, etc

but that is just a warning and not the problem because ...

> Exception in thread "main" java.lang.NullPointerException
> at org.mindswap.pellet.Individual.getRNeighborEdges(Individual.java:680)

there is a null pointer exception, which is unrelated to writing

> at
> org.mindswap.pellet.tableau.completion.rule.SomeValuesRule.applySomeValuesRule(SomeValuesRule.java:120)
> at
> org.mindswap.pellet.tableau.completion.rule.SomeValuesRule.apply(SomeValuesRule.java:64)
> at
> org.mindswap.pellet.tableau.completion.rule.AbstractTableauRule.apply(AbstractTableauRule.java:64)
> at
> org.mindswap.pellet.tableau.completion.SROIQStrategy.complete(SROIQStrategy.java:157)
> at org.mindswap.pellet.ABox.isConsistent(ABox.java:1416)
> at org.mindswap.pellet.ABox.isConsistent(ABox.java:1253)
> at org.mindswap.pellet.KnowledgeBase.consistency(KnowledgeBase.java:1989)
> at org.mindswap.pellet.KnowledgeBase.isConsistent(KnowledgeBase.java:2063)
> at org.mindswap.pellet.jena.PelletInfGraph.prepare(PelletInfGraph.java:263)
> at org.mindswap.pellet.jena.PelletInfGraph.prepare(PelletInfGraph.java:246)
> at
> org.mindswap.pellet.jena.PelletInfGraph.isConsistent(PelletInfGraph.java:274)



>and another creatation with other information under the same process
> routine show the error message below :
>
>
>
>
> Exception in thread "main" com.hp.hpl.jena.shared.BadURIException: Only
> well-formed absolute URIrefs can be included in RDF/XML output:<biological
> process unknown@en>  Code: 57/REQUIRED_COMPONENT_MISSING in SCHEME: A
> component that is required by the scheme is missing.
> at

This:

<biological process unknown@en>

is a bad URI (looks like it should be a literal to me)

> Could someone tell me what's the problems , thanks !
>

	Andy

Re: Problems during creating RDFS and Consistent Check

Posted by Dave Reynolds <da...@gmail.com>.
On 21/03/12 10:23, 锐光刘 wrote:
> My Problems are that I want to  create ontology model  OntModel with the
> given namespace and then check it whit pellet reasoner , it show the error
> message below:
>
>
>
>   WARN [main] (BaseXMLWriter.java:96) - Namespace prefix 'j.2' is reserved

[snip]

> and another creatation with other information under the same process
> routine show the error message below :
>
>
>
>
> Exception in thread "main" com.hp.hpl.jena.shared.BadURIException: Only
> well-formed absolute URIrefs can be included in RDF/XML output:<biological
> process unknown@en>  Code: 57/REQUIRED_COMPONENT_MISSING in SCHEME: A
> component that is required by the scheme is missing.


It looks like Pellet is trying to write out your data as RDF/XML (don't 
know why) and the data is broken. You have what are presumably supposed 
to be literals as the URIs for resources.

If you can't sort it out then show a complete, minimal example of how 
you are creating the data and we'll see if we can spot your error.

Dave