You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Maria Jackson <ma...@gmail.com> on 2013/11/06 14:36:11 UTC
Namespaces for .nq files
Just like .n3 format allows for namespaces of the following form:
@base <http://example.org/alice/foaf.rdf#>
<a> <b> <c>.
Is it also possible to write namespaces in .nq format such that jena
accepts them. I mean is the following format valid for jena (in .nq
format).
@base <http://example.org/alice/foaf.rdf#>
<a> <b> <c> <d>.
Re: Namespaces for .nq files
Posted by Andy Seaborne <an...@apache.org>.
On 06/11/13 13:44, Joshua TAYLOR wrote:
> On Wed, Nov 6, 2013 at 8:36 AM, Maria Jackson
> <ma...@gmail.com> wrote:
>> Just like .n3 format allows for namespaces of the following form:
Base URI resolution. Not quite the same as prefixes.
>>
>> @base <http://example.org/alice/foaf.rdf#>
>> <a> <b> <c>.
>>
>> Is it also possible to write namespaces in .nq format such that jena
>> accepts them. I mean is the following format valid for jena (in .nq
>> format).
>>
>> @base <http://example.org/alice/foaf.rdf#>
>> <a> <b> <c> <d>.
>
>
> Notation3 (N3) is a human readable and writable format with lots of
> syntactic sugar to make RDF authoring easy.
>
> N-Quads [1] is "a line-based syntax for an RDF datasets", and more
> closely related to N-Triples [2]. These just one have triple per
> line, and don't support @prefix or @base. They're very quick to read
> and write (by machine), split and combine, though.
>
> [1] http://www.w3.org/TR/n-quads/#n-quads-language
> [2] http://www.w3.org/TR/n-triples/
>
>
You can use TriG:
@base <http://example.org/alice/foaf.rdf#>
@prefix : <http://example.org/alice/foaf.rdf#>
<d> { <a> <b> :c }
Andy
Re: Namespaces for .nq files
Posted by Andy Seaborne <an...@apache.org>.
On 06/11/13 14:25, Rob Vesse wrote:
> An identical question was asked on
> http://answers.semanticweb.com/questions/25123/namespaces-for-nq-files
which explains why the original email has two spaces before "jena" --
otherwise word perfect (it said "virtuoso and jena").
Different name attached to it. Written today.
Maria - please consolidate the answers across routes to asking the
question so someone coming across the question via one route benefits
from the answers on the other route.
Andy
>
> As I stated there and as Joshua has already stated no NQuads does not
> support syntax compressions like namespace prefixes.
>
> For serialising datasets you may want to look at TriG instead
> (http://www.w3.org/TR/trig/), your example rewritten as valid TriG:
>
> @base <http://example.org/alice/foaf.rdf#> .
>
> <d> { <a> <b> <c> . }
>
>
> Rob
>
> On 06/11/2013 13:44, "Joshua TAYLOR" <jo...@gmail.com> wrote:
>
>> On Wed, Nov 6, 2013 at 8:36 AM, Maria Jackson
>> <ma...@gmail.com> wrote:
>>> Just like .n3 format allows for namespaces of the following form:
>>>
>>> @base <http://example.org/alice/foaf.rdf#>
>>> <a> <b> <c>.
>>>
>>> Is it also possible to write namespaces in .nq format such that jena
>>> accepts them. I mean is the following format valid for jena (in .nq
>>> format).
>>>
>>> @base <http://example.org/alice/foaf.rdf#>
>>> <a> <b> <c> <d>.
>>
>>
>> Notation3 (N3) is a human readable and writable format with lots of
>> syntactic sugar to make RDF authoring easy.
>>
>> N-Quads [1] is "a line-based syntax for an RDF datasets", and more
>> closely related to N-Triples [2]. These just one have triple per
>> line, and don't support @prefix or @base. They're very quick to read
>> and write (by machine), split and combine, though.
>>
>> [1] http://www.w3.org/TR/n-quads/#n-quads-language
>> [2] http://www.w3.org/TR/n-triples/
>>
>>
>> --
>> Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
>
>
>
>
Re: Namespaces for .nq files
Posted by Rob Vesse <rv...@dotnetrdf.org>.
An identical question was asked on
http://answers.semanticweb.com/questions/25123/namespaces-for-nq-files
As I stated there and as Joshua has already stated no NQuads does not
support syntax compressions like namespace prefixes.
For serialising datasets you may want to look at TriG instead
(http://www.w3.org/TR/trig/), your example rewritten as valid TriG:
@base <http://example.org/alice/foaf.rdf#> .
<d> { <a> <b> <c> . }
Rob
On 06/11/2013 13:44, "Joshua TAYLOR" <jo...@gmail.com> wrote:
>On Wed, Nov 6, 2013 at 8:36 AM, Maria Jackson
><ma...@gmail.com> wrote:
>> Just like .n3 format allows for namespaces of the following form:
>>
>> @base <http://example.org/alice/foaf.rdf#>
>> <a> <b> <c>.
>>
>> Is it also possible to write namespaces in .nq format such that jena
>> accepts them. I mean is the following format valid for jena (in .nq
>> format).
>>
>> @base <http://example.org/alice/foaf.rdf#>
>> <a> <b> <c> <d>.
>
>
>Notation3 (N3) is a human readable and writable format with lots of
>syntactic sugar to make RDF authoring easy.
>
>N-Quads [1] is "a line-based syntax for an RDF datasets", and more
>closely related to N-Triples [2]. These just one have triple per
>line, and don't support @prefix or @base. They're very quick to read
>and write (by machine), split and combine, though.
>
>[1] http://www.w3.org/TR/n-quads/#n-quads-language
>[2] http://www.w3.org/TR/n-triples/
>
>
>--
>Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
Re: Namespaces for .nq files
Posted by Joshua TAYLOR <jo...@gmail.com>.
On Wed, Nov 6, 2013 at 8:36 AM, Maria Jackson
<ma...@gmail.com> wrote:
> Just like .n3 format allows for namespaces of the following form:
>
> @base <http://example.org/alice/foaf.rdf#>
> <a> <b> <c>.
>
> Is it also possible to write namespaces in .nq format such that jena
> accepts them. I mean is the following format valid for jena (in .nq
> format).
>
> @base <http://example.org/alice/foaf.rdf#>
> <a> <b> <c> <d>.
Notation3 (N3) is a human readable and writable format with lots of
syntactic sugar to make RDF authoring easy.
N-Quads [1] is "a line-based syntax for an RDF datasets", and more
closely related to N-Triples [2]. These just one have triple per
line, and don't support @prefix or @base. They're very quick to read
and write (by machine), split and combine, though.
[1] http://www.w3.org/TR/n-quads/#n-quads-language
[2] http://www.w3.org/TR/n-triples/
--
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/