You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by "Lebling, David (US SSA)" <da...@baesystems.com> on 2014/04/21 18:09:15 UTC
Fuseki/TDB: BadURIException in DatasetAccessor.putModel
I'm attempting to write a new graph into my TDB repository. The graph has the name of the instance it represents, in this case, "http://anchor/plan#Graph1".
Deep below DatasetAccessor.putModel(), I get the following error:
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.
Placing a breakpoint where the exception is thrown reveals that BaseXMLWrite.checkURI has been given an empty String.
So, I looked for empty URI strings in the Model being written, at least as represented in Eclipse's toString() output. I'm not sure what format(s) the following is in, but I see empty subjects in some triples, all of which are associated with the ontology imports. (It has been edited to remove proprietary info):
<ModelCom
{ @owl:imports http://www.w3.org/2003/01/geo/wgs84_pos;
@owl:imports http://anchor/OntS;
@owl:imports http://anchor/OntC;
@owl:imports http://anchor/OntA;
@owl:imports http://anchor/Core;
@rdf:type owl:Ontology;
http://anchor/plan#Graph1 @cc:meta_modifiedTime "2014-04-21T15:23:40.427Z"^^http://www.w3.org/2001/XMLSchema#dateTime;
http://anchor/plan#Graph1 @cc:meta_createdTime "2014-04-21T15:23:40.427Z"^^http://www.w3.org/2001/XMLSchema#dateTime;
.....
http://anchor/plan#Graph1 @rdf:type OntS:SObject} |
[, http://www.w3.org/2002/07/owl#imports, http://www.w3.org/2003/01/geo/wgs84_pos]
[, http://www.w3.org/2002/07/owl#imports, http://anchor/OntS]
[, http://www.w3.org/2002/07/owl#imports, http://anchor/OntC]
[, http://www.w3.org/2002/07/owl#imports, http://anchor/OntA]
[, http://www.w3.org/2002/07/owl#imports, http://anchor/Core]
[, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/2002/07/owl#Ontology]
[http://anchor/plan#Graph1, http://anchor/Core#meta_modifiedTime, "2014-04-21T15:23:40.427Z"^^http://www.w3.org/2001/XMLSchema#dateTime]
[http://anchor/plan#Graph1, http://anchor/Core#meta_createdTime, "2014-04-21T15:23:40.427Z"^^http://www.w3.org/2001/XMLSchema#dateTime]
.....
[http://anchor/plan#Graph1, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://anchor/OntS#SObject]>
Any ideas?
Dave Lebling
RE: Fuseki/TDB: BadURIException in DatasetAccessor.putModel
Posted by "Lebling, David (US SSA)" <da...@baesystems.com>.
Thank you, Dave R. I think this hits the nail on the head. I view the individual named graphs in the Fuseki/TDB Dataset as not having to be self-contained. I attempted to make them that way to be able to browse them in TopBraid. They are separate for data management purposes, as you suggest.
I think the issue I mentioned with TopBraid happens because it expects everything it reads to be a self-contained ontology document and so it complains if it isn't. It expects to find an owl:Ontology with the same name as the base URI; at least that's what it creates to "fix" an incomplete one, and that does seem to be a pretty standard pattern for other ontologies.
The only drawback of accommodating this (from my point of view) is that either I use the same base URI and Ontology URI for each graph model, or make them unique and end up (I believe) with extra Ontology individuals if I do use the union graph or otherwise concatenate multiple models.
Dave Lebling
-----Original Message-----
From: Dave Reynolds [mailto:dave.e.reynolds@gmail.com]
Hmm. There's two assumptions there which may not be warranted for David's case but only he can tell.
Firstly, you are assuming that there is some value in having the data be legal OWL/DL. A large part of the point of RDF is the whole open world assumption. There is no need at the RDF level (or indeed OWL with RDF
semantics) to have every document be self contained in this way. This is not about what Jena models allows it as about what RDF allows and what OWL profile you need to support (if any).
Secondly, even if David needs OWL DL compliance somewhere it is not clear that each named graph in a DataSet needs to be separately a self-contained ontology. David seems to have a separate named graph for each individual. I would suspect that he regards the ontology as being the union of a set of those named graphs (might even be doing this via a union-default in TDB). In which case perhaps it is only the Union that needs to be DL compliant and have relevant import statements - not every individual component graph (which may there just for data management purposes).
Dave
Re: Fuseki/TDB: BadURIException in DatasetAccessor.putModel
Posted by Dave Reynolds <da...@gmail.com>.
On 22/04/14 14:57, Joshua TAYLOR wrote:
> On Tue, Apr 22, 2014 at 9:25 AM, Lebling, David (US SSA)
> <da...@baesystems.com> wrote:
>> Do these Individuals have to explicitly import the referenced ontologies? The Models they live in all have attached document managers that know about the ontologies. When you talk about "inventing a URI for the ontology" it makes me think the Individuals, which are effectively business objects, have to have, in the Model they live in, an Ontology object. Is this the case?
>>
>> I've been putting in explicit import triples, and the ontology triple we've been discussing. (When writing to a text file I also but in a Base URI.) I find that if I don't put in explicit imports, things seem to work fine, but any files I create by writing out the Individuals, get dire warnings when opened by TopBraid Composer ("offering" to fix the file by adding explicit imports). TopBraid also seems to insist that there be a Base URI. (I realize this isn't a TopBraid list, but I naively assume TopBraid is written by people who know more about OWL than I do, so it makes me nervous when this happens.) Should I just not be nervous?
>
> There's a bit of difference between what you have to or don't have to
> do with Jena models, and what's required in OWL ontologies. Though
> there's an OntModel layer to make some of the ontology abstractions
> nicer, and Jena's submodel concepts helps in working with ontology
> imports, Jena models are really RDF-based. That means that if you've
> got an OntModel with just the triple:
>
> :JohnDoe :hasName "John Doe" .
>
> it's OK. In OWL ontologies, however, it's actually required that all
> the properties, etc., have declarations. So if you want a legal OWL
> ontology, you actually need something more along the lines of (and I
> may be missing some of the details here, but this is the general
> idea):
>
> :JohnDoe a owl:NamedIndividual .
> :hasName a owl:DatatypeProperty .
> :JohnDoe :hasName "John Doe" .
>
> If you don't have those declarations in ontology, then you'll need to
> import some ontology that does. E.g.,
>
> _:ont a owl:Ontology .
> _:ont owl:imports <http://example.org/namingOntology> .
> :JohnDoe a owl:NamedIndividual . # if namingOntology declares
> :JohnDoe, you won't need this triple here
> :JohnDoe :hasName "John Doe" .
>
> So yes, in general, if you've got an ontology O that declares some
> vocabulary, then a dataset that's based on that vocabulary should
> import O.
Hmm. There's two assumptions there which may not be warranted for
David's case but only he can tell.
Firstly, you are assuming that there is some value in having the data be
legal OWL/DL. A large part of the point of RDF is the whole open world
assumption. There is no need at the RDF level (or indeed OWL with RDF
semantics) to have every document be self contained in this way. This is
not about what Jena models allows it as about what RDF allows and what
OWL profile you need to support (if any).
Secondly, even if David needs OWL DL compliance somewhere it is not
clear that each named graph in a DataSet needs to be separately a
self-contained ontology. David seems to have a separate named graph for
each individual. I would suspect that he regards the ontology as being
the union of a set of those named graphs (might even be doing this via a
union-default in TDB). In which case perhaps it is only the Union that
needs to be DL compliant and have relevant import statements - not every
individual component graph (which may there just for data management
purposes).
Dave
Re: Fuseki/TDB: BadURIException in DatasetAccessor.putModel
Posted by Dave Reynolds <da...@gmail.com>.
On 22/04/14 16:40, Lebling, David (US SSA) wrote:
> What does the "_" mean in your example?
It's a bNode (but one with a local name so you can reference it in
multiple places. Could equally well have been:
[] a owl:Ontology ; owl:imports <http://example.org/namingOntology> .
:JohnDoe a owl:NamedIndividual .
Dave
> Dave Lebling
>
> -----Original Message-----
> From: Joshua TAYLOR [mailto:joshuaaaron@gmail.com]
> ...
> If you don't have those declarations in ontology, then you'll need to import some ontology that does. E.g.,
>
> _:ont a owl:Ontology .
> _:ont owl:imports <http://example.org/namingOntology> .
> :JohnDoe a owl:NamedIndividual . # if namingOntology declares :JohnDoe, you won't need this triple here :JohnDoe :hasName "John Doe" .
>
> So yes, in general, if you've got an ontology O that declares some vocabulary, then a dataset that's based on that vocabulary should import O.
>
RE: Fuseki/TDB: BadURIException in DatasetAccessor.putModel
Posted by "Lebling, David (US SSA)" <da...@baesystems.com>.
What does the "_" mean in your example?
Dave Lebling
-----Original Message-----
From: Joshua TAYLOR [mailto:joshuaaaron@gmail.com]
...
If you don't have those declarations in ontology, then you'll need to import some ontology that does. E.g.,
_:ont a owl:Ontology .
_:ont owl:imports <http://example.org/namingOntology> .
:JohnDoe a owl:NamedIndividual . # if namingOntology declares :JohnDoe, you won't need this triple here :JohnDoe :hasName "John Doe" .
So yes, in general, if you've got an ontology O that declares some vocabulary, then a dataset that's based on that vocabulary should import O.
Re: Fuseki/TDB: BadURIException in DatasetAccessor.putModel
Posted by Joshua TAYLOR <jo...@gmail.com>.
On Tue, Apr 22, 2014 at 9:25 AM, Lebling, David (US SSA)
<da...@baesystems.com> wrote:
> Do these Individuals have to explicitly import the referenced ontologies? The Models they live in all have attached document managers that know about the ontologies. When you talk about "inventing a URI for the ontology" it makes me think the Individuals, which are effectively business objects, have to have, in the Model they live in, an Ontology object. Is this the case?
>
> I've been putting in explicit import triples, and the ontology triple we've been discussing. (When writing to a text file I also but in a Base URI.) I find that if I don't put in explicit imports, things seem to work fine, but any files I create by writing out the Individuals, get dire warnings when opened by TopBraid Composer ("offering" to fix the file by adding explicit imports). TopBraid also seems to insist that there be a Base URI. (I realize this isn't a TopBraid list, but I naively assume TopBraid is written by people who know more about OWL than I do, so it makes me nervous when this happens.) Should I just not be nervous?
There's a bit of difference between what you have to or don't have to
do with Jena models, and what's required in OWL ontologies. Though
there's an OntModel layer to make some of the ontology abstractions
nicer, and Jena's submodel concepts helps in working with ontology
imports, Jena models are really RDF-based. That means that if you've
got an OntModel with just the triple:
:JohnDoe :hasName "John Doe" .
it's OK. In OWL ontologies, however, it's actually required that all
the properties, etc., have declarations. So if you want a legal OWL
ontology, you actually need something more along the lines of (and I
may be missing some of the details here, but this is the general
idea):
:JohnDoe a owl:NamedIndividual .
:hasName a owl:DatatypeProperty .
:JohnDoe :hasName "John Doe" .
If you don't have those declarations in ontology, then you'll need to
import some ontology that does. E.g.,
_:ont a owl:Ontology .
_:ont owl:imports <http://example.org/namingOntology> .
:JohnDoe a owl:NamedIndividual . # if namingOntology declares
:JohnDoe, you won't need this triple here
:JohnDoe :hasName "John Doe" .
So yes, in general, if you've got an ontology O that declares some
vocabulary, then a dataset that's based on that vocabulary should
import O.
//JT
--
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
RE: Fuseki/TDB: BadURIException in DatasetAccessor.putModel
Posted by "Lebling, David (US SSA)" <da...@baesystems.com>.
I think this gets to a major source of confusion that I confess I still have after working with OWL for over four years and writing acres of code that uses it.
The named graphs I'm dealing with contain an Individual (only one) of one of the OWL classes defined in my ontologies. So, I have an OWL class "Something" in one of my ontologies, and create Individuals ("Something1", "Something2", etc.) of that class in a Model, and those Individuals use classes and properties defined in the ontologies.
Do these Individuals have to explicitly import the referenced ontologies? The Models they live in all have attached document managers that know about the ontologies. When you talk about "inventing a URI for the ontology" it makes me think the Individuals, which are effectively business objects, have to have, in the Model they live in, an Ontology object. Is this the case?
I've been putting in explicit import triples, and the ontology triple we've been discussing. (When writing to a text file I also but in a Base URI.) I find that if I don't put in explicit imports, things seem to work fine, but any files I create by writing out the Individuals, get dire warnings when opened by TopBraid Composer ("offering" to fix the file by adding explicit imports). TopBraid also seems to insist that there be a Base URI. (I realize this isn't a TopBraid list, but I naively assume TopBraid is written by people who know more about OWL than I do, so it makes me nervous when this happens.) Should I just not be nervous?
Dave Lebling
-----Original Message-----
From: Dave Reynolds [mailto:dave.e.reynolds@gmail.com]
You may want to invent a URI for the ontology that is related to, but different from, your other URIs. Designing the URI architecture is often a non-trivial part of designing a linked data application.
Re: Fuseki/TDB: BadURIException in DatasetAccessor.putModel
Posted by Dave Reynolds <da...@gmail.com>.
On 21/04/14 22:24, Lebling, David (US SSA) wrote:
> Andy and Dave,
>
> Okay, that helped a lot. There is a place in my model creation code that invoked OntModel.createOntology with an empty string for the URI. I changed it to be the same URI as the Individual the model represents. (In my abbreviated sample RDF that Individual is "http://anchor/plan#Graph1". Making this change fixed the problem but it means that the Individual is both a Plan and Ontology now. That will be true for all Individuals stored as graphs.
>
> Somehow this seems odd to me, although I noted some commentary on the web where it was stated that many objects are both some domain-specific class and OWL class Ontology. Is there a more correct way to do this, or is this the standard method?
It's somewhat unusual to have the same thing be both an Ontology and an
Individual in the domain, though not technically illegal.
You may want to invent a URI for the ontology that is related to, but
different from, your other URIs. Designing the URI architecture is
often a non-trivial part of designing a linked data application.
Dave
> -----Original Message-----
> From: Andy Seaborne [mailto:andy@apache.org]
> Sent: Monday, April 21, 2014 4:21 PM
> To: users@jena.apache.org
> Subject: Re: Fuseki/TDB: BadURIException in DatasetAccessor.putModel
>
> On 21/04/14 19:39, Lebling, David (US SSA) wrote:
>> However, in this case I'm not the one who is converting a model to a payload; it's something underneath Fuseki's DatasetAccessor.
>
> The data going in to putModel() has a bad URI - the "" URI.
>
> > This:
> > [, http://www.w3.org/2002/07/owl#imports, http://anchor/OntS] > looks like the subject is the URI string ""
>
> Bad data.
>
> > When I write to a text file, I supply a base URI.
>
> Supplying the baseURI on writing only affects the abbreviation of URIs in the data. They must be absolute in the data in the first place and as the example shows, it's not.
>
> Andy
>
RE: Fuseki/TDB: BadURIException in DatasetAccessor.putModel
Posted by "Lebling, David (US SSA)" <da...@baesystems.com>.
Andy and Dave,
Okay, that helped a lot. There is a place in my model creation code that invoked OntModel.createOntology with an empty string for the URI. I changed it to be the same URI as the Individual the model represents. (In my abbreviated sample RDF that Individual is "http://anchor/plan#Graph1". Making this change fixed the problem but it means that the Individual is both a Plan and Ontology now. That will be true for all Individuals stored as graphs.
Somehow this seems odd to me, although I noted some commentary on the web where it was stated that many objects are both some domain-specific class and OWL class Ontology. Is there a more correct way to do this, or is this the standard method?
Dave
-----Original Message-----
From: Andy Seaborne [mailto:andy@apache.org]
Sent: Monday, April 21, 2014 4:21 PM
To: users@jena.apache.org
Subject: Re: Fuseki/TDB: BadURIException in DatasetAccessor.putModel
On 21/04/14 19:39, Lebling, David (US SSA) wrote:
> However, in this case I'm not the one who is converting a model to a payload; it's something underneath Fuseki's DatasetAccessor.
The data going in to putModel() has a bad URI - the "" URI.
> This:
> [, http://www.w3.org/2002/07/owl#imports, http://anchor/OntS] > looks like the subject is the URI string ""
Bad data.
> When I write to a text file, I supply a base URI.
Supplying the baseURI on writing only affects the abbreviation of URIs in the data. They must be absolute in the data in the first place and as the example shows, it's not.
Andy
Re: Fuseki/TDB: BadURIException in DatasetAccessor.putModel
Posted by Andy Seaborne <an...@apache.org>.
On 21/04/14 19:39, Lebling, David (US SSA) wrote:
> However, in this case I'm not the one who is converting a model to a payload; it's something underneath Fuseki's DatasetAccessor.
The data going in to putModel() has a bad URI - the "" URI.
> This:
> [, http://www.w3.org/2002/07/owl#imports, http://anchor/OntS]
> looks like the subject is the URI string ""
Bad data.
> When I write to a text file, I supply a base URI.
Supplying the baseURI on writing only affects the abbreviation of URIs
in the data. They must be absolute in the data in the first place and
as the example shows, it's not.
Andy
Re: Fuseki/TDB: BadURIException in DatasetAccessor.putModel
Posted by Dave Reynolds <da...@gmail.com>.
On 21/04/14 19:39, Lebling, David (US SSA) wrote:
> When I write to a text file, I supply a base URI. I call RDFWriter.write(Model m, OutputStream os, String baseUri). The RDF statements (in XML_ABBREV format) about the ontology in that case do have 'rdf:about=""' as the subject. When you talk about "<>" do you mean that "<>" should be there instead of ""?
No, I just meant 'rdf:about=""' or equivalent.
> Similarly, I'm not sure what you mean by "creating an ontology programmatically."
[snip]
> (FWIW, the Model I'm trying to put() using Fuseki is created entirely programmatically. It's an OWL translation of an XML document.)
That's what I meant.
From your data dump you seem to have an empty URI for a resource in the
model (specifically the resource that is an instance of owl:Ontology).
This is wrong. When you try to write that out in RDF/XML you will get an
error. Look to the code that generated the model.
Dave
RE: Fuseki/TDB: BadURIException in DatasetAccessor.putModel
Posted by "Lebling, David (US SSA)" <da...@baesystems.com>.
When I write to a text file, I supply a base URI. I call RDFWriter.write(Model m, OutputStream os, String baseUri). The RDF statements (in XML_ABBREV format) about the ontology in that case do have 'rdf:about=""' as the subject. When you talk about "<>" do you mean that "<>" should be there instead of ""? (I'm ignorant of "<>" as an OWL convention for ontologies. I don't think I've ever used it or seen it, alas.)
However, in this case I'm not the one who is converting a model to a payload; it's something underneath Fuseki's DatasetAccessor. Similarly, I'm not sure what you mean by "creating an ontology programmatically." When I create an OntModel, I use an OntModelSpec with a document manager that knows about all the ontologies the model needs. No base URI is supplied or able to be supplied, as far as I know.
(FWIW, the Model I'm trying to put() using Fuseki is created entirely programmatically. It's an OWL translation of an XML document.)
Dave Lebling
-----Original Message-----
From: Dave Reynolds [mailto:dave.e.reynolds@gmail.com]
>....
The URI for your OWL ontology is the empty string which is illegal and can't be written out.
The OWL convention of using <> as the relative URI for an ontology in source XML is fine but when you read it in it will get converted into an absolute URI (that of the source URL you read it in from). So you don't end up with an empty subject URI for your owl:imports in the Jena model.
If you want to create an ontology programatically and generate <> in youir output then you create the owl:Ontology with some known BASE_URI and then use the same BASE_URI as the base when writing out. The RDF/XML-Abbrev writer will generate relative URIs in the output in that case.
Dave
Re: Fuseki/TDB: BadURIException in DatasetAccessor.putModel
Posted by Dave Reynolds <da...@gmail.com>.
On 21/04/14 17:09, Lebling, David (US SSA) wrote:
> I'm attempting to write a new graph into my TDB repository. The graph has the name of the instance it represents, in this case, "http://anchor/plan#Graph1".
>
> Deep below DatasetAccessor.putModel(), I get the following error:
>
> 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.
>
> Placing a breakpoint where the exception is thrown reveals that BaseXMLWrite.checkURI has been given an empty String.
>
> So, I looked for empty URI strings in the Model being written, at least as represented in Eclipse's toString() output. I'm not sure what format(s) the following is in, but I see empty subjects in some triples, all of which are associated with the ontology imports. (It has been edited to remove proprietary info):
>
> <ModelCom
> { @owl:imports http://www.w3.org/2003/01/geo/wgs84_pos;
> @owl:imports http://anchor/OntS;
> @owl:imports http://anchor/OntC;
> @owl:imports http://anchor/OntA;
> @owl:imports http://anchor/Core;
> @rdf:type owl:Ontology;
> http://anchor/plan#Graph1 @cc:meta_modifiedTime "2014-04-21T15:23:40.427Z"^^http://www.w3.org/2001/XMLSchema#dateTime;
> http://anchor/plan#Graph1 @cc:meta_createdTime "2014-04-21T15:23:40.427Z"^^http://www.w3.org/2001/XMLSchema#dateTime;
> .....
> http://anchor/plan#Graph1 @rdf:type OntS:SObject} |
> [, http://www.w3.org/2002/07/owl#imports, http://www.w3.org/2003/01/geo/wgs84_pos]
> [, http://www.w3.org/2002/07/owl#imports, http://anchor/OntS]
> [, http://www.w3.org/2002/07/owl#imports, http://anchor/OntC]
> [, http://www.w3.org/2002/07/owl#imports, http://anchor/OntA]
> [, http://www.w3.org/2002/07/owl#imports, http://anchor/Core]
> [, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/2002/07/owl#Ontology]
> [http://anchor/plan#Graph1, http://anchor/Core#meta_modifiedTime, "2014-04-21T15:23:40.427Z"^^http://www.w3.org/2001/XMLSchema#dateTime]
> [http://anchor/plan#Graph1, http://anchor/Core#meta_createdTime, "2014-04-21T15:23:40.427Z"^^http://www.w3.org/2001/XMLSchema#dateTime]
> .....
> [http://anchor/plan#Graph1, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://anchor/OntS#SObject]>
>
> Any ideas?
The URI for your OWL ontology is the empty string which is illegal and
can't be written out.
The OWL convention of using <> as the relative URI for an ontology in
source XML is fine but when you read it in it will get converted into an
absolute URI (that of the source URL you read it in from). So you don't
end up with an empty subject URI for your owl:imports in the Jena model.
If you want to create an ontology programatically and generate <> in
youir output then you create the owl:Ontology with some known BASE_URI
and then use the same BASE_URI as the base when writing out. The
RDF/XML-Abbrev writer will generate relative URIs in the output in that
case.
Dave
RE: Fuseki/TDB: BadURIException in DatasetAccessor.putModel
Posted by "Lebling, David (US SSA)" <da...@baesystems.com>.
>I can't tell without more information, ideally something that can be run and also a stacktrace.
A runnable example will take some work. I can give you a stack trace easily enough:
-----
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:820)
at com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.relativize(BaseXMLWriter.java:797)
at com.hp.hpl.jena.xmloutput.impl.Basic.writeResourceId(Basic.java:144)
at com.hp.hpl.jena.xmloutput.impl.Basic.writeDescriptionHeader(Basic.java:92)
at com.hp.hpl.jena.xmloutput.impl.Basic.writeRDFStatements(Basic.java:84)
at com.hp.hpl.jena.xmloutput.impl.Basic.writeRDFStatements(Basic.java:74)
at com.hp.hpl.jena.xmloutput.impl.Basic.writeBody(Basic.java:48)
at com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.writeXMLBody(BaseXMLWriter.java:492)
at com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:464)
at com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:450)
at org.apache.jena.riot.adapters.AdapterRDFWriter.write(AdapterRDFWriter.java:52)
at org.apache.jena.riot.RDFDataMgr.write$(RDFDataMgr.java:1226)
at org.apache.jena.riot.RDFDataMgr.write(RDFDataMgr.java:1004)
at org.apache.jena.web.DatasetGraphAccessorHTTP$1.writeTo(DatasetGraphAccessorHTTP.java:230)
at org.apache.http.entity.EntityTemplate.writeTo(EntityTemplate.java:72)
at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:98)
at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108)
at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:122)
at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:271)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.sendRequestEntity(ManagedClientConnectionImpl.java:197)
at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:257)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:717)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:522)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.jena.riot.web.HttpOp.exec(HttpOp.java:1011)
at org.apache.jena.riot.web.HttpOp.execHttpPut(HttpOp.java:894)
at org.apache.jena.web.DatasetGraphAccessorHTTP.doPut(DatasetGraphAccessorHTTP.java:156)
at org.apache.jena.web.DatasetGraphAccessorHTTP.httpPut(DatasetGraphAccessorHTTP.java:151)
at org.apache.jena.web.DatasetAdapter.putModel(DatasetAdapter.java:70)
----
>but it's to do with the model passed into putModel so try writing the model as RDF/XML and as N-triples.
I'll try to do that.
>This:
>[, http://www.w3.org/2002/07/owl#imports, http://anchor/OntS]
>looks like the subject is the URI string ""
That's what it looks like to me too. My question is whether that is evidence for some misbehavior, or whether "" is expected in some cases. What is the expected subject for statements about imports?
>Version?
jena-core (etc.) 2.11, jena-tdb 0.10.1. jena-fuseki 1.0.1.
Dave
Re: Fuseki/TDB: BadURIException in DatasetAccessor.putModel
Posted by Andy Seaborne <an...@apache.org>.
On 21/04/14 17:09, Lebling, David (US SSA) wrote:
> I'm attempting to write a new graph into my TDB repository. The
> graph
has the name of the instance it represents, in this case,
"http://anchor/plan#Graph1".
>
> Deep below DatasetAccessor.putModel(), I get the following error:
>
> 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.
>
> Placing a breakpoint where the exception is thrown reveals that
BaseXMLWrite.checkURI has been given an empty String.
>
> So, I looked for empty URI strings in the Model being written, at
least as represented in Eclipse's toString() output. I'm not sure what
format(s) the following is in, but I see empty subjects in some triples,
all of which are associated with the ontology imports. (It has been
edited to remove proprietary info):
I can't tell without more information, ideally something that can be run
and also a stacktrace.
but it's to do with the model passed into putModel so try writing the
model as RDF/XML and as N-triples.
This:
[, http://www.w3.org/2002/07/owl#imports, http://anchor/OntS]
looks like the subject is the URI string ""
Andy
Version?
> <ModelCom
> { @owl:imports http://www.w3.org/2003/01/geo/wgs84_pos;
> @owl:imports http://anchor/OntS;
> @owl:imports http://anchor/OntC;
> @owl:imports http://anchor/OntA;
> @owl:imports http://anchor/Core;
> @rdf:type owl:Ontology;
> http://anchor/plan#Graph1 @cc:meta_modifiedTime "2014-04-21T15:23:40.427Z"^^http://www.w3.org/2001/XMLSchema#dateTime;
> http://anchor/plan#Graph1 @cc:meta_createdTime "2014-04-21T15:23:40.427Z"^^http://www.w3.org/2001/XMLSchema#dateTime;
> .....
> http://anchor/plan#Graph1 @rdf:type OntS:SObject} |
> [, http://www.w3.org/2002/07/owl#imports, http://www.w3.org/2003/01/geo/wgs84_pos]
> [, http://www.w3.org/2002/07/owl#imports, http://anchor/OntS]
> [, http://www.w3.org/2002/07/owl#imports, http://anchor/OntC]
> [, http://www.w3.org/2002/07/owl#imports, http://anchor/OntA]
> [, http://www.w3.org/2002/07/owl#imports, http://anchor/Core]
> [, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/2002/07/owl#Ontology]
> [http://anchor/plan#Graph1, http://anchor/Core#meta_modifiedTime, "2014-04-21T15:23:40.427Z"^^http://www.w3.org/2001/XMLSchema#dateTime]
> [http://anchor/plan#Graph1, http://anchor/Core#meta_createdTime, "2014-04-21T15:23:40.427Z"^^http://www.w3.org/2001/XMLSchema#dateTime]
> .....
> [http://anchor/plan#Graph1, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://anchor/OntS#SObject]>
>
> Any ideas?
>
> Dave Lebling
>
>