owl - How to correctly specify RDF graph in an SPARQL UPDATE statement -


i created ontology in protege following iri:

http://www.marketplace.org/carrierblueprint# 

and prefix gave mp

now uploaded ontology in fuseki server , trying run update statements.

in ontology there class called carrierprofile, want create new carrier profile using insert statement

(1) tried

insert data {     graph <http://www.marketplace.org/carrierblueprint#>     {         mp:carrierprofile3  rdf:type  mp:carrierprofile.     } } 

-- fuseki server shows update success , when query dont new carrier profile name carrierprofile3

but

(2) when use

insert data {     mp:carrierprofile3  rdf:type  mp:carrierprofile. } 

it successful , when query time new carrier profile name carrierprofile3

i don't understand doing wrong in code 1. not mentioning graph properly?

creating ontology given iri not give uri when upload store. each store has own way of specifying graph new data loaded, in case of fuseki when uploaded ontology file went default graph unnamed.

with fuseki can upload specific named graph entering desired name in upload forms graph field.

you can see data including graph in using following query:

select * {   { ?s ?p ?o } union { graph ?g { ?s ?p ?o } } } 

now far 2 updates go reason both succeed both insert valid data, problem update 1 inserts named graph whereas update 2 inserts unnamed default graph. haven't shown specific query use test if update "worked" assume following:

select * {   ?x mp:carrierprofile . } 

the problem here query queries unnamed default graph after first update won't see changes in graph because updated specific named graph. whereas second update updated default graph query see new data.

you can rewrite query access specific named graph in couple of ways. firstly can use graph clause in first update e.g.

select * {   graph <http://www.marketplace.org/carrierblueprint#>   {     ?x mp:carrierprofile .   } } 

or can use from clause make specific named graph default graph query e.g.

select * <http://www.marketplace.org/carrierblueprint#> {   ?x mp:carrierprofile . } 

Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -