@prefix o: <http://pharma.example/data/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix dcterms: <http://purl.org/dc/terms/> . [] a o:ExploitationOpportunity ; dcterms:title "sad folks" ; o:appraisal 10000000.00 ; dcterms:date "2012-01-01"^^xsd:date .
Needn't be backed by triple store.
GET
and manipulate graphs.PREFIX container: <http://example.org/netWorth/nw1/assetContainer> PREFIX page: <http://example.org/netWorth/nw1/assetContainer?p=> PREFIX membership: <http://example.org/netWorth/nw1> PREFIX asset: <http://example.org/netWorth/nw1/assetContainer/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX bp: <http://open-services.net/ns/basicProfile#> PREFIX o: <http://example.org/ontology/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
DELETE { GRAPH ?LastTail { ?LastTail bp:nextPage ?NewNil } } INSERT { GRAPH ?LastTail { ?LastTail bp:nextPage ?NewTail } GRAPH ?NewTail { container: a bp:Container ; dcterms:title "The assets of JohnZSmith" ; bp:membershipSubject membership: ; bp:membershipPredicate o:asset . ?NewTail a bp:Page ; bp:pageOf container: . } GRAPH ?CurTail { ?CurTail bp:nextPage rdf:nil . membership: a o:NetWorth ; o:asset ?NewObj . ?NewObj a ?type ; dcterms:title ?title ; o:value ?value } GRAPH ?NewObj { ?NewObj a ?type ; dcterms:title ?title ; o:value ?value ; dcterms:date ?date } } CONSTRUCT { ?NewObj a ?type } WHERE { ?oldObj a ?type ; dcterms:title ?title ; o:value ?value ; dcterms:date ?date BIND (ldp:newObj (asset:a) AS ?NewObj) BIND (ldp:lastTail(container:, membership:, o:asset, 4) AS ?LastTail) BIND (ldp:newTail (container:, membership:, o:asset, 4) AS ?NewTail) BIND (ldp:newNil (container:, membership:, o:asset, 4) AS ?NewNil) BIND (ldp:curTail (container:, membership:, o:asset, 4) AS ?CurTail) }
POST
@prefix o: <http://example.org/ontology/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix dcterms: <http://purl.org/dc/terms/> . [] a o:Stock ; dcterms:title "IBM" ; o:value 100.00 ; dcterms:date "2012-01-01"^^xsd:date .
match
?oldObj a ?type ; dcterms:title ?title ; o:value ?value ; dcterms:date ?date BIND (ldp:newObj (asset:a) AS ?NewObj) BIND (ldp:lastTail(container:, membership:, o:asset, 4) AS ?LastTail) BIND (ldp:newTail (container:, membership:, o:asset, 4) AS ?NewTail) BIND (ldp:newNil (container:, membership:, o:asset, 4) AS ?NewNil) BIND (ldp:curTail (container:, membership:, o:asset, 4) AS ?CurTail)
(pivoted) results by page
attr | 1st value | last on page | first on new page |
---|---|---|---|
?oldObj | _:b1 | _:b1 | _:b1 |
?type | o:Stock | o:Stock | o:Stock |
?NewObj | asset:a1 | asset:a4 | asset:a5 |
?LastTail | page:1 | page:1 | page:2 |
?NewTail | NULL | NULL | page:2 |
?NewNil | NULL | rdf:nil | NULL |
?CurTail | page:1 | page:1 | page:2 |
Comparing operations on a LDP Container and a GDP endpoint.
details at http://www.w3.org/2012/ldp/wiki/ISSUE-37
operation | SPARQL GSP | LDP |
---|---|---|
POST /interface/ | create new graph G return 201/204, Location: G | create new graph G return 201, Location: G |
PUT /interface/ | new graph G return 201, Location: G | |
GET G | return 200, G | return 200, G |
PUT G | return 200, replace G | return 200, replace G |
DELETE G | return 200, delete G | return 200, delete G |
GET /interface/ | SPARQL service description graph | return 200, page1 with ref to G |
Can an LDP Container and a GDP endpoint cohabitate?
Sure, they just need to know which they are.
Can one endpoint be both an LDP Container and a GDP endpoint?
Conflicts on: