You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Erich Bremer <er...@ebremer.com> on 2014/11/04 19:32:01 UTC
Prefixes in Trig
Hi,
I am writing RDF datasets out from Jena to disk and I noticed that the
prefix definitions are missing, meaning, all predicates are written out in
the long URI form rather than something compact like "foaf:knows" with the
foaf prefix defined up at the top. The name spaces were defined the a Jena
Model and then that model was added as a named graph to a empty dataset then
written out to disk. Is this expected behavior from Jena or a bug or am I
missing something here? - Erich
Re: Prefixes in Trig
Posted by Andy Seaborne <an...@apache.org>.
On 05/11/14 09:39, Rob Vesse wrote:
> I think this is expected and by-design behaviour
>
> A Dataset does not carry any prefixes directly rather prefixes are only
> carried on the individual Models that may be placed inside the Dataset.
> AFAICT when writing datasets out ARQ only considers prefixes from the
> default graph by default so if you don't have any data in your default
> graph you would likely have no prefixes.
>
> Part of the problem is that ARQ doesn't know what the underlying storage
> of a Dataset instance is and so gathers the prefixes prior to carrying out
> the actual writing. The actual writing is then typically done purely in
> terms of quads rather than graphs/models so the writers doesn't have
> access to the prefixes of specific models.
>
> Changing the existing behaviour to try and gather the prefixes from all
> graphs could be done but may produce a significant performance hit in some
> cases.
>
> Rob
Yes - in the case of the general "you can put any model in it", the
prefixes exist with the model.
If you parse into the dataset, the prefixes do end up in the dataset's
choice (default graph).
And of course there is the situation where one prefix is used twice for
different things. It's not the external vocabularies so much as the
local data with ":".
In all syntaxes that have prefixes, you can change prefix declaration
mid way through but that in itself can be unexpected.
| expectations | > | design choices |
Andy
>
> On 04/11/2014 10:32, "Erich Bremer" <er...@ebremer.com> wrote:
>
>> Hi,
>>
>> I am writing RDF datasets out from Jena to disk and I noticed that the
>> prefix definitions are missing, meaning, all predicates are written out
>> in
>> the long URI form rather than something compact like "foaf:knows" with
>> the
>> foaf prefix defined up at the top. The name spaces were defined the a
>> Jena
>> Model and then that model was added as a named graph to a empty dataset
>> then
>> written out to disk. Is this expected behavior from Jena or a bug or am
>> I
>> missing something here? - Erich
>>
>>
>
>
>
>
Re: Prefixes in Trig
Posted by Rob Vesse <rv...@dotnetrdf.org>.
I think this is expected and by-design behaviour
A Dataset does not carry any prefixes directly rather prefixes are only
carried on the individual Models that may be placed inside the Dataset.
AFAICT when writing datasets out ARQ only considers prefixes from the
default graph by default so if you don't have any data in your default
graph you would likely have no prefixes.
Part of the problem is that ARQ doesn't know what the underlying storage
of a Dataset instance is and so gathers the prefixes prior to carrying out
the actual writing. The actual writing is then typically done purely in
terms of quads rather than graphs/models so the writers doesn't have
access to the prefixes of specific models.
Changing the existing behaviour to try and gather the prefixes from all
graphs could be done but may produce a significant performance hit in some
cases.
Rob
On 04/11/2014 10:32, "Erich Bremer" <er...@ebremer.com> wrote:
>Hi,
>
>I am writing RDF datasets out from Jena to disk and I noticed that the
>prefix definitions are missing, meaning, all predicates are written out
>in
>the long URI form rather than something compact like "foaf:knows" with
>the
>foaf prefix defined up at the top. The name spaces were defined the a
>Jena
>Model and then that model was added as a named graph to a empty dataset
>then
>written out to disk. Is this expected behavior from Jena or a bug or am
>I
>missing something here? - Erich
>
>