Re: SELECTing s properties in the same query

2017-04-15 Thread A. Soroka
Jena's DESCRIBE behavior is pluggable. [1] If you can live with one "hop" on bnode traversal, you can use a plain query with isBlank. I'm sure this could be written better, but something like: CONSTRUCT { ?sub ?pred ?obj } WHERE { { VALUES ?sub { } ?sub ?pred ?obj . } UNION {

Re: SELECTing s properties in the same query

2017-04-15 Thread james anderson
good afternoon; > On 2017-04-15, at 11:43, Laura Morales wrote: > >> Blank node closure is non-trivial > > wouldn't be this the same problem with URLs as well? yes, in general. > For example if a node is pointing to another resource's URL and I want to > retrieve some

Re: SELECTing s properties in the same query

2017-04-15 Thread Laura Morales
> Blank node closure is non-trivial wouldn't be this the same problem with URLs as well? For example if a node is pointing to another resource's URL and I want to retrieve some properties of that linked resource from the same query?

Re: SELECTing s properties in the same query

2017-04-15 Thread Rurik Thomas Greenall
In a trivial way, perhaps you can specify something like: SELECT * WHERE { ?property ?object OPTIONAL { ?object ?subProperty ?subObject . FILTER (isBlank(?object)) } } This assumes nothing about structure and may perform badly. On Fri, Apr 14, 2017 at 4:17 PM, Laura Morales

Re: SELECTing s properties in the same query

2017-04-15 Thread Lorenz B.
Blank node closure is non-trivial and not part of the SPARQL specs. That means, you either a) have to do some pre-processing of the data b) use some extensions, e.g. in Jena you can use a DESCRIBE query which supports blank nodes closure, see [1] (Note, that DESCRIBE returns an RDF graph instead

SELECTing s properties in the same query

2017-04-14 Thread Laura Morales
If I have these nquands (in Turtle syntax) ns:name "My name" ; ns:address [ ns:street "Street name" ; ns:number "42" . ] . ns:name "Another name" ; ns:address [ ns:street "Another street" ;