Thanks Andy, and apologize for my silly question. Since I am the one who writes the http interface and only internal components that will call my interface, then I'd just introduce another arg in the query string for that additional data, hence nothing need to change in the SPARQL query.
Thanks again, Z ________________________________________ From: Andy Seaborne <[email protected]> Sent: Sunday, September 13, 2015 5:25 AM To: [email protected] Subject: Re: pass additional data in sparql On 11/09/15 15:48, Zen 98052 wrote: > If I want to pass additional data (in addition to triples pattern) in > SPARQL, does it mean I have to deal with quad? Or is there another > way? > > The additional data can be a firm id, for example it only queries > data from that firm id partition (in our custom storage) > > > Thanks, > > Z > Hi there - some background about your custom back-end storage would be helpful. I am unclear as to why namign the firm by it's URI is not what you ant. { <http://example/firm?id=123> ?p ?o } is all triples with <http://example/firm?id=123> as subject. Make increasingly complicated patterns for cases where that links to other related data. The only points SPARQL accesses the data are in triple matching and GRAPH ?g. So you could use GRAPH: GRAPH <http://example/firm?id=123> { .... } or even GRAPH ?g { ... } FILTER ( some condition on ?g ) But the target dataset for the query can be described with FROM (and FROM NAMED) which gives you another place to set up the query SELECT ... FROM <http://example/firm?id=123> WHERE { ... } (the last is the least flexible) Andy
