You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Martynas Jusevičius <ma...@graphity.org> on 2015/08/18 11:52:30 UTC

Quad store HTTP semantics

This was getting off-topic, so I changed the subject.

So these HTTP operations would have to be executed on a a quad
endpoint that represents the dataset as a whole? And if I PUT a single
quad, the whole store would be wiped and replaced with it? Or am I
missing something?

Dydra has documented some HTTP logic here - are we talking about the same thing?
https://github.com/dydra/sparql-tests/blob/master/suites/http-api/README.md#triples-quads-and-named-graph-in-import-requests

On Tue, Aug 18, 2015 at 8:57 AM, Andy Seaborne <an...@apache.org> wrote:
> On 17/08/15 22:40, Martynas Jusevičius wrote:
>>
>> So what are the semantics of POSTing quads and PUTing quads?
>
>
> Append and replace as per HTTP.
>
> RFC 7231: 4.3.3. POST
> ...
>       - Extending a database through an append operation.
> ...
>
> (any ordering implied by "extend" is irrelevant for a set of quads)
>
>
> RFC 7231: 4.3.4.  PUT
>
>    The PUT method requests that the state of the target resource be
>    created or replaced with the state defined by the representation
>    enclosed in the request message payload.
>
>
>>
>> On Mon, Aug 17, 2015 at 11:32 PM, Andy Seaborne <an...@apache.org> wrote:
>>>
>>> On 17/08/15 22:21, Martynas Jusevičius wrote:
>>>>
>>>>
>>>> Is that an oversight in the GSP spec?
>>>
>>>
>>>
>>> Not really - the GET/POST/PUT on the dataset itself is just normal use of
>>> HTTP.
>>>
>>> The "Graph Store Protocol" for managing a graph store.  What it really
>>> adds
>>> is the naming convention, ?default and ?graph.
>>>
>>>          Andy
>>>
>>>
>>>>
>>>> I had done something similar (which I use as a low-level API):
>>>>
>>>>
>>>> https://github.com/Graphity/graphity-core/blob/master/src/main/java/org/graphity/core/util/DataManager.java
>>>>
>>>>
>>>> On Mon, Aug 17, 2015 at 10:16 PM, Andy Seaborne <an...@apache.org> wrote:
>>>>>
>>>>>
>>>>> On 17/08/15 20:26, Martynas Jusevičius wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> Andy,
>>>>>>
>>>>>> I have a related question. What if I have a Dataset at hand, not a
>>>>>> Model - how do I send it to a remote Graph Store?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> The SPARQL Graph Store Protocol does not mention this.  Fuseki supports
>>>>> REST-ish PUT/POST/GET on the dataset URL.
>>>>>
>>>>> Currently, you need to send it yourself -- HttpOp.execHttpPost has lots
>>>>> for
>>>>> support for that e.g. see DatasetGraphAccessorHTTP for sending a model
>>>>> -
>>>>> generalise to datasets.
>>>>>
>>>>> We have been talking about this on dev@
>>>>>
>>>>>
>>>>>
>>>>> http://mail-archives.apache.org/mod_mbox/jena-dev/201508.mbox/%3C55BE6A0B.5020404%40apache.org%3E
>>>>>
>>>>> where we're talking about bring the remote (and local) interaction
>>>>> together
>>>>> and whetre I'm suggesting adding the plain-old HTTP ops on teh dataset
>>>>> URL.
>>>>>
>>>>>           Andy
>>>>>
>>>>>
>>>>>>
>>>>>> Martynas
>>>>>>
>>>>>> On Mon, Aug 17, 2015 at 9:19 PM, Andy Seaborne <an...@apache.org>
>>>>>> wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> DatasetAccessor
>>>>>>>
>>>>>>> This is the API to the SPARQL Graph Store Protocol.
>>>>>>>
>>>>>>> Model model = ...
>>>>>>> DatasetAccessor acc = DatasetAccessorFactory.createHTTP
>>>>>>>            ("http://.../datasets/data") ;
>>>>>>> acc.add(model) ; // adds to existign data, if any.
>>>>>>>
>>>>>>> or
>>>>>>>
>>>>>>> acc.putModel(model) -- which overwrites existing data
>>>>>>>
>>>>>>>
>>>>>>> On 17/08/15 20:11, ajs6f@virginia.edu wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> There may be a better answer for this, but at the very least, you
>>>>>>>> can
>>>>>>>> serialize your triples/quads and use SPARQL Update to send them to
>>>>>>>> your
>>>>>>>> Fuseki instance.
>>>>>>>>
>>>>>>>>
>>>>>>>> ---
>>>>>>>> A. Soroka
>>>>>>>> The University of Virginia Library
>>>>>>>>
>>>>>>>> On Aug 17, 2015, at 3:08 PM, Andy Doddington
>>>>>>>> <an...@gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 17 Aug 2015, at 19:50, Andy Doddington
>>>>>>>>> <an...@googlemail.com> wrote:
>>>>>>>>>
>>>>>>>>> Hoping the subject makes my query clear - since I am a total newbie
>>>>>>>>> in
>>>>>>>>> this area.
>>>>>>>>>
>>>>>>>>> I have created a tiny model, using
>>>>>>>>> ModelFactory.createDefaultModel()
>>>>>>>>> to
>>>>>>>>> create my initially empty model,
>>>>>>>>> which I then populate manually.
>>>>>>>>>
>>>>>>>>> So, having done this, is there any way that I can persist this to a
>>>>>>>>> Fuseki database running on a remote server?
>>>>>>>>>
>>>>>>>>> Thanks for any help,
>>>>>>>>>
>>>>>>>>>            Andy D
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>
>>>
>

Re: Quad store HTTP semantics

Posted by Andy Seaborne <an...@apache.org>.
On 18/08/15 12:10, james anderson wrote:
> good afternoon;
>
>
>> On 2015-08-18, at 12:35, Andy Seaborne <andy@apache.org
>> <ma...@apache.org>> wrote:
>>
>>> […]
>>
>> That is the definition of PUT for HTTP always. See quote from the RFC.
>> "created or replaced", the old content is lost.  There is nothing
>> special about SPARQL, RDF or linked data here.
>>
>> That's why the graph store protocol is needed for adding naming to
>> direct operations to specific graphs in a store
>>
>> In HTTP if any app does GET after PUT, then the returned resource (up
>> to conneg and concurrency) is the thing that was PUT and only that.
>>
>> POST is the additive operation.
>> […]
>
> while i do find the notion quite appealing, that the url query arguments
> determine the effective protocol independent of endpoint, i would never
> have dared to suggest it.
> if there was any commentary during the ratification process, it would be
> useful to be able to refer parties to it, when they ask.

The protocol is HTTP and it's verbs.  OK - POST is often used in weird 
and wonderful ways but the spec does define "append to database" as one 
blessed usage. It is what HTTP has always said.

The other essential point is that different URLs name a different 
resource.  A query string makes it a different URL.  We/people think of 
arguments to an endpoint but HTTP does not actually say that.

In HTTP,

http://host/form.html&name=foo

and

http://host/form.html

are different (web, http) resources.

So in GSP,

http://host/dataset?default
http://host/dataset?graph=...

are all different (web, http) resources
and different to http://host/dataset
so that's why

http://host/dataset?query=....

returning a result set is not a representation of the dataset.

	Andy

Cross posting and setting the reply to tech@dydra.com will confuse things!


>
>>
>>
>>> Dydra has documented some HTTP logic here - are we talking about the
>>> same thing?
>>> https://github.com/dydra/sparql-tests/blob/master/suites/http-api/README.md#triples-quads-and-named-graph-in-import-requests
>>
>> Some of the descriptions looks a bit dodgy.  "add" is used in PUT
>> descriptions - could be a typo.
>
> the intent is to distinguish the “clear” from the “add” aspects as the
> former may have its own consequences.
> if that was omitted somewhere, please advise.
>
> best regards, from berlin,
>
>>
>> Specifically, which tests are your referring to in that long list?
>>  Some are GSP related, some acting on the repository.
>>
>>>
>>> On Tue, Aug 18, 2015 at 8:57 AM, Andy Seaborne <andy@apache.org
>>> <ma...@apache.org>> wrote:
>>>> On 17/08/15 22:40, Martynas Jusevičius wrote:
>>>>>
>>>>> So what are the semantics of POSTing quads and PUTing quads?
>>>>
>>>>
>>>> Append and replace as per HTTP.
>>>>
>>>> RFC 7231: 4.3.3. POST
>>>> ...
>>>>       - Extending a database through an append operation.
>>>> ...
>>>>
>>>> (any ordering implied by "extend" is irrelevant for a set of quads)
>>>>
>>>>
>>>> RFC 7231: 4.3.4.  PUT
>>>>
>>>>    The PUT method requests that the state of the target resource be
>>>>    created or replaced with the state defined by the representation
>>>>    enclosed in the request message payload.
>>>>
>>>>
>>>>>
>>>>> On Mon, Aug 17, 2015 at 11:32 PM, Andy Seaborne <andy@apache.org
>>>>> <ma...@apache.org>> wrote:
>>>>>>
>>>>>> On 17/08/15 22:21, Martynas Jusevičius wrote:
>>>>>>>
>>>>>>>
>>>>>>> Is that an oversight in the GSP spec?
>>>>>>
>>>>>>
>>>>>>
>>>>>> Not really - the GET/POST/PUT on the dataset itself is just normal
>>>>>> use of
>>>>>> HTTP.
>>>>>>
>>>>>> The "Graph Store Protocol" for managing a graph store.  What it really
>>>>>> adds
>>>>>> is the naming convention, ?default and ?graph.
>>>>>>
>>>>>>          Andy
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> I had done something similar (which I use as a low-level API):
>>>>>>>
>>>>>>>
>>>>>>> https://github.com/Graphity/graphity-core/blob/master/src/main/java/org/graphity/core/util/DataManager.java
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Aug 17, 2015 at 10:16 PM, Andy Seaborne <an...@apache.org>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>> On 17/08/15 20:26, Martynas Jusevičius wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Andy,
>>>>>>>>>
>>>>>>>>> I have a related question. What if I have a Dataset at hand, not a
>>>>>>>>> Model - how do I send it to a remote Graph Store?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> The SPARQL Graph Store Protocol does not mention this.  Fuseki
>>>>>>>> supports
>>>>>>>> REST-ish PUT/POST/GET on the dataset URL.
>>>>>>>>
>>>>>>>> Currently, you need to send it yourself -- HttpOp.execHttpPost
>>>>>>>> has lots
>>>>>>>> for
>>>>>>>> support for that e.g. see DatasetGraphAccessorHTTP for sending a
>>>>>>>> model
>>>>>>>> -
>>>>>>>> generalise to datasets.
>>>>>>>>
>>>>>>>> We have been talking about this on dev@
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> http://mail-archives.apache.org/mod_mbox/jena-dev/201508.mbox/%3C55BE6A0B.5020404%40apache.org%3E
>>>>>>>>
>>>>>>>> where we're talking about bring the remote (and local) interaction
>>>>>>>> together
>>>>>>>> and whetre I'm suggesting adding the plain-old HTTP ops on teh
>>>>>>>> dataset
>>>>>>>> URL.
>>>>>>>>
>>>>>>>>           Andy
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Martynas
>>>>>>>>>
>>>>>>>>> On Mon, Aug 17, 2015 at 9:19 PM, Andy Seaborne <an...@apache.org>
>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> DatasetAccessor
>>>>>>>>>>
>>>>>>>>>> This is the API to the SPARQL Graph Store Protocol.
>>>>>>>>>>
>>>>>>>>>> Model model = ...
>>>>>>>>>> DatasetAccessor acc = DatasetAccessorFactory.createHTTP
>>>>>>>>>>            ("http://.../datasets/data") ;
>>>>>>>>>> acc.add(model) ; // adds to existign data, if any.
>>>>>>>>>>
>>>>>>>>>> or
>>>>>>>>>>
>>>>>>>>>> acc.putModel(model) -- which overwrites existing data
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 17/08/15 20:11, ajs6f@virginia.edu wrote:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> There may be a better answer for this, but at the very least, you
>>>>>>>>>>> can
>>>>>>>>>>> serialize your triples/quads and use SPARQL Update to send
>>>>>>>>>>> them to
>>>>>>>>>>> your
>>>>>>>>>>> Fuseki instance.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ---
>>>>>>>>>>> A. Soroka
>>>>>>>>>>> The University of Virginia Library
>>>>>>>>>>>
>>>>>>>>>>> On Aug 17, 2015, at 3:08 PM, Andy Doddington
>>>>>>>>>>> <an...@gmail.com>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On 17 Aug 2015, at 19:50, Andy Doddington
>>>>>>>>>>>> <an...@googlemail.com> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> Hoping the subject makes my query clear - since I am a total
>>>>>>>>>>>> newbie
>>>>>>>>>>>> in
>>>>>>>>>>>> this area.
>>>>>>>>>>>>
>>>>>>>>>>>> I have created a tiny model, using
>>>>>>>>>>>> ModelFactory.createDefaultModel()
>>>>>>>>>>>> to
>>>>>>>>>>>> create my initially empty model,
>>>>>>>>>>>> which I then populate manually.
>>>>>>>>>>>>
>>>>>>>>>>>> So, having done this, is there any way that I can persist
>>>>>>>>>>>> this to a
>>>>>>>>>>>> Fuseki database running on a remote server?
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks for any help,
>>>>>>>>>>>>
>>>>>>>>>>>>            Andy D
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>
>>>>
>>
>
> ---
> james anderson | james@dydra.com <ma...@dydra.com> | http://dydra.com
>
>
>
>
>


Re: Quad store HTTP semantics

Posted by Andy Seaborne <an...@apache.org>.
On 18/08/15 10:52, Martynas Jusevičius wrote:
> This was getting off-topic, so I changed the subject.
>
> So these HTTP operations would have to be executed on a a quad
> endpoint that represents the dataset as a whole? And if I PUT a single
> quad, the whole store would be wiped and replaced with it? Or am I
> missing something?

That is the definition of PUT for HTTP always. See quote from the RFC. 
"created or replaced", the old content is lost.  There is nothing 
special about SPARQL, RDF or linked data here.

That's why the graph store protocol is needed for adding naming to 
direct operations to specific graphs in a store

In HTTP if any app does GET after PUT, then the returned resource (up to 
conneg and concurrency) is the thing that was PUT and only that.

POST is the additive operation.

So
PUT datsetURL
<s> <p> <o> <g> .
whether 200 (replacing) or 201 (created)

GET datsetURL
==>
<s> <p> <o> <g> .


> Dydra has documented some HTTP logic here - are we talking about the same thing?
> https://github.com/dydra/sparql-tests/blob/master/suites/http-api/README.md#triples-quads-and-named-graph-in-import-requests

Some of the descriptions looks a bit dodgy.  "add" is used in PUT 
descriptions - could be a typo.

Specifically, which tests are your referring to in that long list?  Some 
are GSP related, some acting on the repository.

>
> On Tue, Aug 18, 2015 at 8:57 AM, Andy Seaborne <an...@apache.org> wrote:
>> On 17/08/15 22:40, Martynas Jusevičius wrote:
>>>
>>> So what are the semantics of POSTing quads and PUTing quads?
>>
>>
>> Append and replace as per HTTP.
>>
>> RFC 7231: 4.3.3. POST
>> ...
>>        - Extending a database through an append operation.
>> ...
>>
>> (any ordering implied by "extend" is irrelevant for a set of quads)
>>
>>
>> RFC 7231: 4.3.4.  PUT
>>
>>     The PUT method requests that the state of the target resource be
>>     created or replaced with the state defined by the representation
>>     enclosed in the request message payload.
>>
>>
>>>
>>> On Mon, Aug 17, 2015 at 11:32 PM, Andy Seaborne <an...@apache.org> wrote:
>>>>
>>>> On 17/08/15 22:21, Martynas Jusevičius wrote:
>>>>>
>>>>>
>>>>> Is that an oversight in the GSP spec?
>>>>
>>>>
>>>>
>>>> Not really - the GET/POST/PUT on the dataset itself is just normal use of
>>>> HTTP.
>>>>
>>>> The "Graph Store Protocol" for managing a graph store.  What it really
>>>> adds
>>>> is the naming convention, ?default and ?graph.
>>>>
>>>>           Andy
>>>>
>>>>
>>>>>
>>>>> I had done something similar (which I use as a low-level API):
>>>>>
>>>>>
>>>>> https://github.com/Graphity/graphity-core/blob/master/src/main/java/org/graphity/core/util/DataManager.java
>>>>>
>>>>>
>>>>> On Mon, Aug 17, 2015 at 10:16 PM, Andy Seaborne <an...@apache.org> wrote:
>>>>>>
>>>>>>
>>>>>> On 17/08/15 20:26, Martynas Jusevičius wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Andy,
>>>>>>>
>>>>>>> I have a related question. What if I have a Dataset at hand, not a
>>>>>>> Model - how do I send it to a remote Graph Store?
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> The SPARQL Graph Store Protocol does not mention this.  Fuseki supports
>>>>>> REST-ish PUT/POST/GET on the dataset URL.
>>>>>>
>>>>>> Currently, you need to send it yourself -- HttpOp.execHttpPost has lots
>>>>>> for
>>>>>> support for that e.g. see DatasetGraphAccessorHTTP for sending a model
>>>>>> -
>>>>>> generalise to datasets.
>>>>>>
>>>>>> We have been talking about this on dev@
>>>>>>
>>>>>>
>>>>>>
>>>>>> http://mail-archives.apache.org/mod_mbox/jena-dev/201508.mbox/%3C55BE6A0B.5020404%40apache.org%3E
>>>>>>
>>>>>> where we're talking about bring the remote (and local) interaction
>>>>>> together
>>>>>> and whetre I'm suggesting adding the plain-old HTTP ops on teh dataset
>>>>>> URL.
>>>>>>
>>>>>>            Andy
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> Martynas
>>>>>>>
>>>>>>> On Mon, Aug 17, 2015 at 9:19 PM, Andy Seaborne <an...@apache.org>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> DatasetAccessor
>>>>>>>>
>>>>>>>> This is the API to the SPARQL Graph Store Protocol.
>>>>>>>>
>>>>>>>> Model model = ...
>>>>>>>> DatasetAccessor acc = DatasetAccessorFactory.createHTTP
>>>>>>>>             ("http://.../datasets/data") ;
>>>>>>>> acc.add(model) ; // adds to existign data, if any.
>>>>>>>>
>>>>>>>> or
>>>>>>>>
>>>>>>>> acc.putModel(model) -- which overwrites existing data
>>>>>>>>
>>>>>>>>
>>>>>>>> On 17/08/15 20:11, ajs6f@virginia.edu wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> There may be a better answer for this, but at the very least, you
>>>>>>>>> can
>>>>>>>>> serialize your triples/quads and use SPARQL Update to send them to
>>>>>>>>> your
>>>>>>>>> Fuseki instance.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ---
>>>>>>>>> A. Soroka
>>>>>>>>> The University of Virginia Library
>>>>>>>>>
>>>>>>>>> On Aug 17, 2015, at 3:08 PM, Andy Doddington
>>>>>>>>> <an...@gmail.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 17 Aug 2015, at 19:50, Andy Doddington
>>>>>>>>>> <an...@googlemail.com> wrote:
>>>>>>>>>>
>>>>>>>>>> Hoping the subject makes my query clear - since I am a total newbie
>>>>>>>>>> in
>>>>>>>>>> this area.
>>>>>>>>>>
>>>>>>>>>> I have created a tiny model, using
>>>>>>>>>> ModelFactory.createDefaultModel()
>>>>>>>>>> to
>>>>>>>>>> create my initially empty model,
>>>>>>>>>> which I then populate manually.
>>>>>>>>>>
>>>>>>>>>> So, having done this, is there any way that I can persist this to a
>>>>>>>>>> Fuseki database running on a remote server?
>>>>>>>>>>
>>>>>>>>>> Thanks for any help,
>>>>>>>>>>
>>>>>>>>>>             Andy D
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>
>>>>
>>


Re: Quad store HTTP semantics

Posted by Martynas Jusevičius <ma...@graphity.org>.
James,

so which of the entries in the table represents the following case?

    PUT /rdf-graph-store
    Host: example.com
    Content-Type: application/n-quads

    <http://one.example/subject1> <http://one.example/predicate1>
<http://one.example/object1> <http://example.org/graph1> .

If no graph is specified, and /rdf-graph-store is a "graph store
endpoint, which pertains to the entire content of a repository", will
such request replace that content with a single quad?

On Tue, Aug 18, 2015 at 12:15 PM, james anderson <ja...@dydra.com> wrote:
> good morning;
>
>
>> On 2015-08-18, at 11:52, Martynas Jusevičius <ma...@graphity.org> wrote:
>>
>> This was getting off-topic, so I changed the subject.
>>
>> So these HTTP operations would have to be executed on a a quad
>> endpoint that represents the dataset as a whole? And if I PUT a single
>> quad, the whole store would be wiped and replaced with it? Or am I
>> missing something?
>>
>> Dydra has documented some HTTP logic here - are we talking about the same thing?
>> https://github.com/dydra/sparql-tests/blob/master/suites/http-api/README.md#triples-quads-and-named-graph-in-import-requests
>
> not entirely.
>
> the graph store protocol specifies nothing for quad content types.
> the text refers to operations in the manner of
>
>    store the enclosed RDF payload as RDF graph content
>
> where the common definition for “RDF graph content” and the examples, such as
>
>     PUT /rdf-graph-store?graph=..graph_uri.. HTTP/1.1
>     Host: example.com
>     Content-Type: text/turtle
>
>     ... RDF payload ...
>
>
>     DROP SILENT GRAPH <graph_uri>;
>     INSERT DATA { GRAPH <graph_uri> { .. RDF payload .. } }
>
> indicate that protocol pertains to triple request and reply content only.
> that is any quad data is constructed by combining the specified graph with triple content.
>
> which leaves open the behavior with respect to quad content.
>
> in order that we (that is dydra) do not need to define and implement an otherwise redundant service to support quad content, we extend the graph store protocol to define the server actions for quad content in addition to triple content.
> absent such support, for example, there is no way to address a request to a graph store endpoint, which pertains to the entire content of a repository within a single transaction, as each request would be restricted to a single graph.
> such operations are the subject of the table, cited above.
>
> best regards, from berlin,
>
>>
>> On Tue, Aug 18, 2015 at 8:57 AM, Andy Seaborne <an...@apache.org> wrote:
>>> On 17/08/15 22:40, Martynas Jusevičius wrote:
>>>>
>>>> So what are the semantics of POSTing quads and PUTing quads?
>>>
>>>
>>> Append and replace as per HTTP.
>>>
>>> RFC 7231: 4.3.3. POST
>>> ...
>>>      - Extending a database through an append operation.
>>> ...
>>>
>>> (any ordering implied by "extend" is irrelevant for a set of quads)
>>>
>>>
>>> RFC 7231: 4.3.4.  PUT
>>>
>>>   The PUT method requests that the state of the target resource be
>>>   created or replaced with the state defined by the representation
>>>   enclosed in the request message payload.
>>>
>>>
>>>>
>>>> On Mon, Aug 17, 2015 at 11:32 PM, Andy Seaborne <an...@apache.org> wrote:
>>>>>
>>>>> On 17/08/15 22:21, Martynas Jusevičius wrote:
>>>>>>
>>>>>>
>>>>>> Is that an oversight in the GSP spec?
>>>>>
>>>>>
>>>>>
>>>>> Not really - the GET/POST/PUT on the dataset itself is just normal use of
>>>>> HTTP.
>>>>>
>>>>> The "Graph Store Protocol" for managing a graph store.  What it really
>>>>> adds
>>>>> is the naming convention, ?default and ?graph.
>>>>>
>>>>>         Andy
>>>>>
>>>>>
>>>>>>
>>>>>> I had done something similar (which I use as a low-level API):
>>>>>>
>>>>>>
>>>>>> https://github.com/Graphity/graphity-core/blob/master/src/main/java/org/graphity/core/util/DataManager.java
>>>>>>
>>>>>>
>>>>>> On Mon, Aug 17, 2015 at 10:16 PM, Andy Seaborne <an...@apache.org> wrote:
>>>>>>>
>>>>>>>
>>>>>>> On 17/08/15 20:26, Martynas Jusevičius wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Andy,
>>>>>>>>
>>>>>>>> I have a related question. What if I have a Dataset at hand, not a
>>>>>>>> Model - how do I send it to a remote Graph Store?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> The SPARQL Graph Store Protocol does not mention this.  Fuseki supports
>>>>>>> REST-ish PUT/POST/GET on the dataset URL.
>>>>>>>
>>>>>>> Currently, you need to send it yourself -- HttpOp.execHttpPost has lots
>>>>>>> for
>>>>>>> support for that e.g. see DatasetGraphAccessorHTTP for sending a model
>>>>>>> -
>>>>>>> generalise to datasets.
>>>>>>>
>>>>>>> We have been talking about this on dev@
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> http://mail-archives.apache.org/mod_mbox/jena-dev/201508.mbox/%3C55BE6A0B.5020404%40apache.org%3E
>>>>>>>
>>>>>>> where we're talking about bring the remote (and local) interaction
>>>>>>> together
>>>>>>> and whetre I'm suggesting adding the plain-old HTTP ops on teh dataset
>>>>>>> URL.
>>>>>>>
>>>>>>>          Andy
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> Martynas
>>>>>>>>
>>>>>>>> On Mon, Aug 17, 2015 at 9:19 PM, Andy Seaborne <an...@apache.org>
>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> DatasetAccessor
>>>>>>>>>
>>>>>>>>> This is the API to the SPARQL Graph Store Protocol.
>>>>>>>>>
>>>>>>>>> Model model = ...
>>>>>>>>> DatasetAccessor acc = DatasetAccessorFactory.createHTTP
>>>>>>>>>           ("http://.../datasets/data") ;
>>>>>>>>> acc.add(model) ; // adds to existign data, if any.
>>>>>>>>>
>>>>>>>>> or
>>>>>>>>>
>>>>>>>>> acc.putModel(model) -- which overwrites existing data
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 17/08/15 20:11, ajs6f@virginia.edu wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> There may be a better answer for this, but at the very least, you
>>>>>>>>>> can
>>>>>>>>>> serialize your triples/quads and use SPARQL Update to send them to
>>>>>>>>>> your
>>>>>>>>>> Fuseki instance.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ---
>>>>>>>>>> A. Soroka
>>>>>>>>>> The University of Virginia Library
>>>>>>>>>>
>>>>>>>>>> On Aug 17, 2015, at 3:08 PM, Andy Doddington
>>>>>>>>>> <an...@gmail.com>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 17 Aug 2015, at 19:50, Andy Doddington
>>>>>>>>>>> <an...@googlemail.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>> Hoping the subject makes my query clear - since I am a total newbie
>>>>>>>>>>> in
>>>>>>>>>>> this area.
>>>>>>>>>>>
>>>>>>>>>>> I have created a tiny model, using
>>>>>>>>>>> ModelFactory.createDefaultModel()
>>>>>>>>>>> to
>>>>>>>>>>> create my initially empty model,
>>>>>>>>>>> which I then populate manually.
>>>>>>>>>>>
>>>>>>>>>>> So, having done this, is there any way that I can persist this to a
>>>>>>>>>>> Fuseki database running on a remote server?
>>>>>>>>>>>
>>>>>>>>>>> Thanks for any help,
>>>>>>>>>>>
>>>>>>>>>>>           Andy D
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>
>>>
>
> ---
> james anderson | james@dydra.com | http://dydra.com
>
>
>
>
>

Re: Quad store HTTP semantics

Posted by james anderson <ja...@dydra.com>.
good morning;


> On 2015-08-18, at 11:52, Martynas Jusevičius <ma...@graphity.org> wrote:
> 
> This was getting off-topic, so I changed the subject.
> 
> So these HTTP operations would have to be executed on a a quad
> endpoint that represents the dataset as a whole? And if I PUT a single
> quad, the whole store would be wiped and replaced with it? Or am I
> missing something?
> 
> Dydra has documented some HTTP logic here - are we talking about the same thing?
> https://github.com/dydra/sparql-tests/blob/master/suites/http-api/README.md#triples-quads-and-named-graph-in-import-requests

not entirely.

the graph store protocol specifies nothing for quad content types.
the text refers to operations in the manner of

   store the enclosed RDF payload as RDF graph content

where the common definition for “RDF graph content” and the examples, such as

    PUT /rdf-graph-store?graph=..graph_uri.. HTTP/1.1
    Host: example.com
    Content-Type: text/turtle
    
    ... RDF payload ...    
    

    DROP SILENT GRAPH <graph_uri>;
    INSERT DATA { GRAPH <graph_uri> { .. RDF payload .. } }

indicate that protocol pertains to triple request and reply content only.
that is any quad data is constructed by combining the specified graph with triple content.

which leaves open the behavior with respect to quad content.

in order that we (that is dydra) do not need to define and implement an otherwise redundant service to support quad content, we extend the graph store protocol to define the server actions for quad content in addition to triple content.
absent such support, for example, there is no way to address a request to a graph store endpoint, which pertains to the entire content of a repository within a single transaction, as each request would be restricted to a single graph.
such operations are the subject of the table, cited above.

best regards, from berlin,

> 
> On Tue, Aug 18, 2015 at 8:57 AM, Andy Seaborne <an...@apache.org> wrote:
>> On 17/08/15 22:40, Martynas Jusevičius wrote:
>>> 
>>> So what are the semantics of POSTing quads and PUTing quads?
>> 
>> 
>> Append and replace as per HTTP.
>> 
>> RFC 7231: 4.3.3. POST
>> ...
>>      - Extending a database through an append operation.
>> ...
>> 
>> (any ordering implied by "extend" is irrelevant for a set of quads)
>> 
>> 
>> RFC 7231: 4.3.4.  PUT
>> 
>>   The PUT method requests that the state of the target resource be
>>   created or replaced with the state defined by the representation
>>   enclosed in the request message payload.
>> 
>> 
>>> 
>>> On Mon, Aug 17, 2015 at 11:32 PM, Andy Seaborne <an...@apache.org> wrote:
>>>> 
>>>> On 17/08/15 22:21, Martynas Jusevičius wrote:
>>>>> 
>>>>> 
>>>>> Is that an oversight in the GSP spec?
>>>> 
>>>> 
>>>> 
>>>> Not really - the GET/POST/PUT on the dataset itself is just normal use of
>>>> HTTP.
>>>> 
>>>> The "Graph Store Protocol" for managing a graph store.  What it really
>>>> adds
>>>> is the naming convention, ?default and ?graph.
>>>> 
>>>>         Andy
>>>> 
>>>> 
>>>>> 
>>>>> I had done something similar (which I use as a low-level API):
>>>>> 
>>>>> 
>>>>> https://github.com/Graphity/graphity-core/blob/master/src/main/java/org/graphity/core/util/DataManager.java
>>>>> 
>>>>> 
>>>>> On Mon, Aug 17, 2015 at 10:16 PM, Andy Seaborne <an...@apache.org> wrote:
>>>>>> 
>>>>>> 
>>>>>> On 17/08/15 20:26, Martynas Jusevičius wrote:
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> Andy,
>>>>>>> 
>>>>>>> I have a related question. What if I have a Dataset at hand, not a
>>>>>>> Model - how do I send it to a remote Graph Store?
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> The SPARQL Graph Store Protocol does not mention this.  Fuseki supports
>>>>>> REST-ish PUT/POST/GET on the dataset URL.
>>>>>> 
>>>>>> Currently, you need to send it yourself -- HttpOp.execHttpPost has lots
>>>>>> for
>>>>>> support for that e.g. see DatasetGraphAccessorHTTP for sending a model
>>>>>> -
>>>>>> generalise to datasets.
>>>>>> 
>>>>>> We have been talking about this on dev@
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> http://mail-archives.apache.org/mod_mbox/jena-dev/201508.mbox/%3C55BE6A0B.5020404%40apache.org%3E
>>>>>> 
>>>>>> where we're talking about bring the remote (and local) interaction
>>>>>> together
>>>>>> and whetre I'm suggesting adding the plain-old HTTP ops on teh dataset
>>>>>> URL.
>>>>>> 
>>>>>>          Andy
>>>>>> 
>>>>>> 
>>>>>>> 
>>>>>>> Martynas
>>>>>>> 
>>>>>>> On Mon, Aug 17, 2015 at 9:19 PM, Andy Seaborne <an...@apache.org>
>>>>>>> wrote:
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> DatasetAccessor
>>>>>>>> 
>>>>>>>> This is the API to the SPARQL Graph Store Protocol.
>>>>>>>> 
>>>>>>>> Model model = ...
>>>>>>>> DatasetAccessor acc = DatasetAccessorFactory.createHTTP
>>>>>>>>           ("http://.../datasets/data") ;
>>>>>>>> acc.add(model) ; // adds to existign data, if any.
>>>>>>>> 
>>>>>>>> or
>>>>>>>> 
>>>>>>>> acc.putModel(model) -- which overwrites existing data
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On 17/08/15 20:11, ajs6f@virginia.edu wrote:
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> There may be a better answer for this, but at the very least, you
>>>>>>>>> can
>>>>>>>>> serialize your triples/quads and use SPARQL Update to send them to
>>>>>>>>> your
>>>>>>>>> Fuseki instance.
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> ---
>>>>>>>>> A. Soroka
>>>>>>>>> The University of Virginia Library
>>>>>>>>> 
>>>>>>>>> On Aug 17, 2015, at 3:08 PM, Andy Doddington
>>>>>>>>> <an...@gmail.com>
>>>>>>>>> wrote:
>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> On 17 Aug 2015, at 19:50, Andy Doddington
>>>>>>>>>> <an...@googlemail.com> wrote:
>>>>>>>>>> 
>>>>>>>>>> Hoping the subject makes my query clear - since I am a total newbie
>>>>>>>>>> in
>>>>>>>>>> this area.
>>>>>>>>>> 
>>>>>>>>>> I have created a tiny model, using
>>>>>>>>>> ModelFactory.createDefaultModel()
>>>>>>>>>> to
>>>>>>>>>> create my initially empty model,
>>>>>>>>>> which I then populate manually.
>>>>>>>>>> 
>>>>>>>>>> So, having done this, is there any way that I can persist this to a
>>>>>>>>>> Fuseki database running on a remote server?
>>>>>>>>>> 
>>>>>>>>>> Thanks for any help,
>>>>>>>>>> 
>>>>>>>>>>           Andy D
>>>>>>>>>> 
>>>>>>>>> 
>>>>>>>> 
>>>>>> 
>>>> 
>> 

---
james anderson | james@dydra.com | http://dydra.com