Skip to content

Instantly share code, notes, and snippets.

@danielsmith-eu
Created January 6, 2014 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save danielsmith-eu/8291794 to your computer and use it in GitHub Desktop.
Save danielsmith-eu/8291794 to your computer and use it in GitHub Desktop.
SELECT DISTINCT
wb_v_latest_triples.triple_order, wb_v_latest_triples.subject,
wb_v_latest_triples.predicate, wb_v_latest_triples.obj_value,
wb_v_latest_triples.obj_type, wb_v_latest_triples.obj_lang,
wb_v_latest_triples.obj_datatype FROM wb_v_latest_triples
JOIN wb_v_latest_triples AS j_1 ON (wb_v_latest_triples.subject = j_1.subject)
JOIN wb_v_latest_triples AS j_2 ON (wb_v_latest_triples.subject = j_2.subject)
JOIN wb_v_latest_triples AS j_3 ON (wb_v_latest_triples.subject = j_3.subject)
WHERE
(j_1.predicate = 'type' AND j_1.obj_value = 'http://indx.ecs.soton.ac.uk/ontology/root-box/#server')
OR (j_2.predicate = 'box' AND j_2.obj_value = j_3.subject)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment