[n2-dev] Finding the URI for a newly created blank node

4 views
Skip to first unread message

Rupert Redington

unread,
May 6, 2010, 7:57:54 AM5/6/10
to n2-dev
Hi All,

As I understand it (which may well be imperfectly), when I post rdf
representing a blank node to a store I can expect (if all goes well)
an HTTP 201 or 202 response which will include a 'Location' header
giving the URI for the newly created node.

However, when I post the following rdf to my store the response is a
204 'No Content'. What have I failed to understand here?

Thanks in advance,

Rupert
NeonTribe

sample.rdf
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rev="http://purl.org/stuff/rev#"
xmlns:rdfs="http://www.w3.org/TR/rdf-schema/"
xmlns:pb="http://plingback.plings.net/ontologies/plingback#"
>
<rdf:Description>
<rdfs:type rdf:resource="http://purl.org/stuff/rev#Review"/>
<pb:plingBackType rdf:resource="http://plingback.plings.net/
applications/fastfeedback"/>
<rev:rating rdf:datatype="http://www.w3.org/2001/
XMLSchema#integer">5</rev:rating>
</rdf:Description>
</rdf:RDF>

curl command (account details redacted):
curl -v --digest -u"***:***" -d @sample.rdf -H content-
type:application/rdf+xml http://api.talis.com/stores/plings-dev2/meta


curl results:
* About to connect() to api.talis.com port 80 (#0)
* Trying 82.147.9.16... connected
* Connected to api.talis.com (82.147.9.16) port 80 (#0)
* Server auth using Digest with user '***'
> POST /stores/plings-dev2/meta HTTP/1.1
> User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15
> Host: api.talis.com
> Accept: */*
> content-type:application/rdf+xml
> Content-Length: 0
>
< HTTP/1.1 401 Unauthorized
< WWW-Authenticate: Digest realm="bigfoot", domain="null",
nonce="********", algorithm=MD5, qop="auth"
< Content-Type: text/plain
< Content-Length: 12
<
* Ignoring the response-body
* Connection #0 to host api.talis.com left intact
* Issue another request to this URL: 'http://api.talis.com/stores/
plings-dev2/meta'
* Re-using existing connection! (#0) with host api.talis.com
* Connected to api.talis.com (82.147.9.16) port 80 (#0)
* Server auth using Digest with user '****'
> POST /stores/plings-dev2/meta HTTP/1.1
> Authorization: Digest username="***", realm="bigfoot", nonce="****", uri="/stores/plings-dev2/meta", cnonce="MDcyODQ0", nc=00000001, qop="auth", response="639ac387f4b70957a758c874f310b2dd", algorithm="MD5"
> User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15
> Host: api.talis.com
> Accept: */*
> content-type:application/rdf+xml
> Content-Length: 556
>
< HTTP/1.1 204 No Content
< Cache-Control: max-age=7200, must-revalidate
< server: Bigfoot/35.1396.60748
<
* Connection #0 to host api.talis.com left intact
* Closing connection #0

--
----
n-squared : Talis Platform Developers
Mailing List : http://groups.google.com/group/n2-dev
Wiki : http://n2.talis.com

Sam Tunnicliffe

unread,
May 6, 2010, 8:24:45 AM5/6/10
to n2-...@googlegroups.com
Hi Rupert,

Successfully posting RDF documents (containing bnodes or not) to a Store via the  /meta uri will always return a 204 response, and the Platform doesn't return any further information about the content of the update. 

The Location header is returned when posting a single changeset, and only when recording that changeset (not just applying the delta it describes), which is done by  POSTing it to /meta/changesets.
In that scenario, the Location header is used to communicate the URI that the Store assigns to the Changeset itself. 

There are further details about this part of the api here: http://n2.talis.com/wiki/Metabox

HTH
Sam


Please consider the environment before printing this email.

Find out more about Talis at http://www.talis.com/
shared innovation™

Any views or personal opinions expressed within this email may not be those of Talis Information Ltd or its employees. The content of this email message and any files that may be attached are confidential, and for the usage of the intended recipient only. If you are not the intended recipient, then please return this message to the sender and delete it. Any use of this e-mail by an unauthorised recipient is prohibited.

Talis Information Ltd is a member of the Talis Group of companies and is registered in England No 3638278 with its registered office at Knights Court, Solihull Parkway, Birmingham Business Park, B37 7YB.



--
Sam Tunnicliffe
Head of Development, Platform Division
Talis Systems Ltd
http://www.talis.com

Rupert Redington

unread,
May 6, 2010, 9:07:03 AM5/6/10
to n2-dev
Thanks Sam,

That does clear up my misunderstanding, but leaves me a little
stumped.

It seems there's no way for me to identify the parts of the graph
which were modified by my request if the data doesn't contain any
unique values. I guess the primary key pattern (http://n2.talis.com/
wiki/Primary_Key_Pattern) is my best bet for a solution.

I'm a bit wary of it because of the overhead in requests it imposes,
but also because it seems a duplication of effort, since the nodes
just added to the store have usable identifiers which are guaranteed
to be unique - if only I could find out what they were...

Does anyone have a tip for me?

Rupert
> > type:application/rdf+xmlhttp://api.talis.com/stores/plings-dev2/meta
> > Find out more about Talis athttp://www.talis.com/
> > shared innovation™
>
> > Any views or personal opinions expressed within this email may not be those
> > of Talis Information Ltd or its employees. The content of this email message
> > and any files that may be attached are confidential, and for the usage of
> > the intended recipient only. If you are not the intended recipient, then
> > please return this message to the sender and delete it. Any use of this
> > e-mail by an unauthorised recipient is prohibited.
>
> > Talis Information Ltd is a member of the Talis Group of companies and is
> > registered in England No 3638278 with its registered office at Knights
> > Court, Solihull Parkway, Birmingham Business Park, B37 7YB.
>
> --
> Sam Tunnicliffe
> Head of Development, Platform Division
> Talis Systems Ltdhttp://www.talis.com
>
> --
> ----
> n-squared : Talis Platform Developers
> Mailing List :http://groups.google.com/group/n2-dev
> Wiki :http://n2.talis.com

Reply all
Reply to author
Forward
0 new messages