There is some interest in the linked data community in coming up with such a rest model for named graphs.
Addressing triples in a named graph requires two things
for (1) we can identify the named graph with the RDF/XML representation of the OSLC Defined Resource. (The URI of the named graph is the URI of the RDF/XML (Turtle etc) document that serialises those triples.)
for (2) i suggest that we use the following query-like presentation (i think Martin used this first on the OSLC blog. need to search out the citation.)
for triple <s,p,o> in graph g we have
U ::= g?subject=s&predicate=p&object=o
Often, g and s are the same URI so this can be abbreviated, if desired.
A GET on U yields <s,p,o>
A PUT on U replaces <s,p,o> in g with <s,p,o> in the body
A POST on U with body <s,p,o> adds <s,p,o> to g
A DELETE on U removes <s,p,o> from g
Some examples.
consder the following resource:
<R rdf:about="http://example.com/req1">
<dc:title>A title for req1<dc:title/>
<dc:contributor>Ian</dc:contributor>
<implementedBy rdf:resource="urn:wi1"/>
<elaboratedBy rdf:resource="urn:model1"/>
</R>
Assume that implementedBy and elaboratedBy are multi-valued properties.
The URI of the graph is the URI of the document; in OSLC we typically identify the HTTP resource with the subject of the rdf:Description node in the RDF/XML. In this case, that's "http://example.com/req1".
So g == http://example.com/req1
Example: GET http://example.com/req1
returns the representation shown above
Example: GET http://example.com/req1?predicate=implementedBy
returns
<R rdf:about="http://example.com/req1">
<implementedBy rdf:resource="urn:wi1"/>
</R>
Example: PUT http://example.com/req1?predicate=implementedBy
Body:
<R rdf:about="http://example.com/req1">
<implementedBy rdf:resource="urn:wi1"/>
<implementedBy rdf:resource="urn:wi3"/>
</R>
Adds an implemented by link to req1.
DELETE http://example.com/req1?predicate=implementedBy&object=urn:wi3
removes the link to wi3.
<R rdf:about="http://example.com/req1">
<supportedBy rdf:resource="urn:model2"/>
</R>
Creates a new "supportedBy" link to model2