-
-
Save selenamarie/8291809 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH j_1 AS ( | |
SELECT subject | |
FROM wb_v_latest_triples a | |
WHERE | |
a.predicate = 'type' AND a.obj_value = 'http://indx.ecs.soton.ac.uk/ontology/root-box/#server' | |
), | |
WITH j_2 AS ( | |
SELECT subject | |
FROM wb_v_latest_triples a | |
WHERE | |
a.predicate = 'box' | |
) | |
SELECT DISTINCT | |
j.triple_order, | |
j.subject, | |
j.predicate, | |
j.obj_value, | |
j.obj_type, | |
j.obj_lang, | |
j.obj_datatype | |
FROM wb_v_latest_triples as j | |
JOIN j_1 USING subject | |
JOIN j_2 USING subject | |
JOIN wb_v_latest_triples AS j_3 ON (j.subject = j_3.subject) | |
WHERE | |
j_2.obj_value = j_3.subject -- concerned about the 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