You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Miika Alonen <ma...@csc.fi> on 2014/09/30 08:08:40 UTC

Overwriting namespaces in fuseki

Hi, 
I was trying to fix misspelled namespaces in fuseki using graph protocol, but it seems that i cant. Here is example of the problem in json-ld where i try to change the ex namespace in context: 

POST Content-Type "application/ld+json": 
{ 
"@graph" : [ { 
"@id" : "ex:Test", 
"@type" : "rdfs:Class", 
"label" : "Test" 
} ], 
"@id" : "urn:x-arq:DefaultGraphNode", 
"@context" : { 
"label" : "http://www.w3.org/2000/01/rdf-schema#label", 
"rdfs" : "http://www.w3.org/2000/01/rdf-schema#", 
"ex" : "http://example.org/typo/" 
} 
} 

ex: namespace changed in context, send using PUT Content-Type "application/ld+json": 
{ 
"@graph" : [ { 
"@id" : "ex:Test", 
"@type" : "rdfs:Class", 
"label" : "Test" 
} ], 
"@id" : "urn:x-arq:DefaultGraphNode", 
"@context" : { 
"label" : "http://www.w3.org/2000/01/rdf-schema#label", 
"rdfs" : "http://www.w3.org/2000/01/rdf-schema#", 
"ex" : "http://example.org/NEW/" 
} 
} 

Now if you do GET you get back: 
{ 
"@graph" : [ { 
"@id" : "http://example.org/NEW/Test", 
"@type" : "rdfs:Class", 
"label" : "Test" 
} ], 
"@id" : "urn:x-arq:DefaultGraphNode", 
"@context" : { 
"label" : "http://www.w3.org/2000/01/rdf-schema#label", 
"rdfs" : "http://www.w3.org/2000/01/rdf-schema#", 
"ex" : "http://example.org/typo/" 
} 
} 

Which is not what i expected. How do i overwrite prefixed namespace ex? 

br, 
Miika 


Re: Overwriting namespaces in fuseki

Posted by Andy Seaborne <an...@apache.org>.
Hi Miika,

OK - I have a simpler version and I've recorded this as JENA-793.

Two PUTs (with just namespaces) show the problem (so it's not POST related).

	Andy

https://issues.apache.org/jira/browse/JENA-793

On 30/09/14 14:46, Miika Alonen wrote:
> I used fuseki 1.1.0 and 1.1.1 with the same result. Format doesnt seem to affect the results, i tried turtle and json-ld.
>
> I tested with default config.ttl and sent POST&PUT&GET to http://localhost:3030/ds/data?graph=default. And yes, urn:x-arq:DefaultGraphNode was unnecessary, but removing it doesnt change a thing.
>
> However, it seems that the problem is only with in-memory datastore, i tried the same with the tdb and it works as expected.
>
> - Miika
>
> ----- Original Message -----
> From: "Andy Seaborne" <an...@apache.org>
> To: users@jena.apache.org
> Sent: Tuesday, 30 September, 2014 3:34:20 PM
> Subject: Re: Overwriting namespaces in fuseki
>
> Hi there,
>
> When you say "POST" and "PUT" - to what URL are those operations being
> applied?
>
> Does the same thing happen with other formats?
>
> (urn:x-arq:DefaultGraphNode shouldn't be needed or seen -- but the GET
> seems to add it which is wrong).
>
> Which version of Fuseki are you running?
>
> 	Andy
>
> On 30/09/14 07:08, Miika Alonen wrote:
>> Hi,
>> I was trying to fix misspelled namespaces in fuseki using graph protocol, but it seems that i cant. Here is example of the problem in json-ld where i try to change the ex namespace in context:
>>
>> POST Content-Type "application/ld+json":
>> {
>> "@graph" : [ {
>> "@id" : "ex:Test",
>> "@type" : "rdfs:Class",
>> "label" : "Test"
>> } ],
>> "@id" : "urn:x-arq:DefaultGraphNode",
>> "@context" : {
>> "label" : "http://www.w3.org/2000/01/rdf-schema#label",
>> "rdfs" : "http://www.w3.org/2000/01/rdf-schema#",
>> "ex" : "http://example.org/typo/"
>> }
>> }
>>
>> ex: namespace changed in context, send using PUT Content-Type "application/ld+json":
>> {
>> "@graph" : [ {
>> "@id" : "ex:Test",
>> "@type" : "rdfs:Class",
>> "label" : "Test"
>> } ],
>> "@id" : "urn:x-arq:DefaultGraphNode",
>> "@context" : {
>> "label" : "http://www.w3.org/2000/01/rdf-schema#label",
>> "rdfs" : "http://www.w3.org/2000/01/rdf-schema#",
>> "ex" : "http://example.org/NEW/"
>> }
>> }
>>
>> Now if you do GET you get back:
>> {
>> "@graph" : [ {
>> "@id" : "http://example.org/NEW/Test",
>> "@type" : "rdfs:Class",
>> "label" : "Test"
>> } ],
>> "@id" : "urn:x-arq:DefaultGraphNode",
>> "@context" : {
>> "label" : "http://www.w3.org/2000/01/rdf-schema#label",
>> "rdfs" : "http://www.w3.org/2000/01/rdf-schema#",
>> "ex" : "http://example.org/typo/"
>> }
>> }
>>
>> Which is not what i expected. How do i overwrite prefixed namespace ex?
>>
>> br,
>> Miika
>
>


Re: Overwriting namespaces in fuseki

Posted by Miika Alonen <ma...@csc.fi>.
I used fuseki 1.1.0 and 1.1.1 with the same result. Format doesnt seem to affect the results, i tried turtle and json-ld.

I tested with default config.ttl and sent POST&PUT&GET to http://localhost:3030/ds/data?graph=default. And yes, urn:x-arq:DefaultGraphNode was unnecessary, but removing it doesnt change a thing.

However, it seems that the problem is only with in-memory datastore, i tried the same with the tdb and it works as expected.

- Miika

----- Original Message -----
From: "Andy Seaborne" <an...@apache.org>
To: users@jena.apache.org
Sent: Tuesday, 30 September, 2014 3:34:20 PM
Subject: Re: Overwriting namespaces in fuseki

Hi there,

When you say "POST" and "PUT" - to what URL are those operations being 
applied?

Does the same thing happen with other formats?

(urn:x-arq:DefaultGraphNode shouldn't be needed or seen -- but the GET 
seems to add it which is wrong).

Which version of Fuseki are you running?

	Andy

On 30/09/14 07:08, Miika Alonen wrote:
> Hi,
> I was trying to fix misspelled namespaces in fuseki using graph protocol, but it seems that i cant. Here is example of the problem in json-ld where i try to change the ex namespace in context:
>
> POST Content-Type "application/ld+json":
> {
> "@graph" : [ {
> "@id" : "ex:Test",
> "@type" : "rdfs:Class",
> "label" : "Test"
> } ],
> "@id" : "urn:x-arq:DefaultGraphNode",
> "@context" : {
> "label" : "http://www.w3.org/2000/01/rdf-schema#label",
> "rdfs" : "http://www.w3.org/2000/01/rdf-schema#",
> "ex" : "http://example.org/typo/"
> }
> }
>
> ex: namespace changed in context, send using PUT Content-Type "application/ld+json":
> {
> "@graph" : [ {
> "@id" : "ex:Test",
> "@type" : "rdfs:Class",
> "label" : "Test"
> } ],
> "@id" : "urn:x-arq:DefaultGraphNode",
> "@context" : {
> "label" : "http://www.w3.org/2000/01/rdf-schema#label",
> "rdfs" : "http://www.w3.org/2000/01/rdf-schema#",
> "ex" : "http://example.org/NEW/"
> }
> }
>
> Now if you do GET you get back:
> {
> "@graph" : [ {
> "@id" : "http://example.org/NEW/Test",
> "@type" : "rdfs:Class",
> "label" : "Test"
> } ],
> "@id" : "urn:x-arq:DefaultGraphNode",
> "@context" : {
> "label" : "http://www.w3.org/2000/01/rdf-schema#label",
> "rdfs" : "http://www.w3.org/2000/01/rdf-schema#",
> "ex" : "http://example.org/typo/"
> }
> }
>
> Which is not what i expected. How do i overwrite prefixed namespace ex?
>
> br,
> Miika



Re: Overwriting namespaces in fuseki

Posted by Andy Seaborne <an...@apache.org>.
Hi there,

When you say "POST" and "PUT" - to what URL are those operations being 
applied?

Does the same thing happen with other formats?

(urn:x-arq:DefaultGraphNode shouldn't be needed or seen -- but the GET 
seems to add it which is wrong).

Which version of Fuseki are you running?

	Andy

On 30/09/14 07:08, Miika Alonen wrote:
> Hi,
> I was trying to fix misspelled namespaces in fuseki using graph protocol, but it seems that i cant. Here is example of the problem in json-ld where i try to change the ex namespace in context:
>
> POST Content-Type "application/ld+json":
> {
> "@graph" : [ {
> "@id" : "ex:Test",
> "@type" : "rdfs:Class",
> "label" : "Test"
> } ],
> "@id" : "urn:x-arq:DefaultGraphNode",
> "@context" : {
> "label" : "http://www.w3.org/2000/01/rdf-schema#label",
> "rdfs" : "http://www.w3.org/2000/01/rdf-schema#",
> "ex" : "http://example.org/typo/"
> }
> }
>
> ex: namespace changed in context, send using PUT Content-Type "application/ld+json":
> {
> "@graph" : [ {
> "@id" : "ex:Test",
> "@type" : "rdfs:Class",
> "label" : "Test"
> } ],
> "@id" : "urn:x-arq:DefaultGraphNode",
> "@context" : {
> "label" : "http://www.w3.org/2000/01/rdf-schema#label",
> "rdfs" : "http://www.w3.org/2000/01/rdf-schema#",
> "ex" : "http://example.org/NEW/"
> }
> }
>
> Now if you do GET you get back:
> {
> "@graph" : [ {
> "@id" : "http://example.org/NEW/Test",
> "@type" : "rdfs:Class",
> "label" : "Test"
> } ],
> "@id" : "urn:x-arq:DefaultGraphNode",
> "@context" : {
> "label" : "http://www.w3.org/2000/01/rdf-schema#label",
> "rdfs" : "http://www.w3.org/2000/01/rdf-schema#",
> "ex" : "http://example.org/typo/"
> }
> }
>
> Which is not what i expected. How do i overwrite prefixed namespace ex?
>
> br,
> Miika