Difference between revisions of "Sandbox"
Jump to navigation
Jump to search
(Created page with "{{SPARQLcountry|country=Q681|visualization=Q803}}") |
|||
Line 1: | Line 1: | ||
− | {{ | + | {{SPARQLPredicateGraph |
+ | |filter_values_colors=(pdio:Q401 "EEEEEE")(pdio:Q646 "222288") | ||
+ | |filter_predicate=pdiot:P3 | ||
+ | |predicates_subjects_objects_colors=(pdiot:P111 pdio:Q401 pdio:Q646 "EEEEEE")(pdiot:P111 pdio:Q646 pdio:Q401 "222288") | ||
+ | |node_condition=pdiot:P55 pdio:Q564 | ||
+ | }} |
Revision as of 08:51, 21 May 2019
- defaultView:Graph
SELECT ?item1 ?item1Label ?rgb ?item2 ?item2Label WITH {
SELECT ?predicateFilterValue ?predicateFilterValueRGB WHERE { VALUES (?predicateFilterValue ?predicateFilterValueRGB) { (pdio:Q401 "EEEEEE")(pdio:Q646 "222288") } }
} AS %predicateFilterValues WITH {
SELECT ?predicate ?subjectValue ?objectValue ?predicateRGB WHERE { VALUES (?predicate ?subjectValue ?objectValue ?predicateRGB) { (pdiot:P111 pdio:Q401 pdio:Q646 "EEEEEE")(pdiot:P111 pdio:Q646 pdio:Q401 "222288") } }
} AS %predicates WITH {SELECT ?node ?nodeRGB WHERE {
?node pdiot:P55 pdio:Q564. ?node {{{predicate}}} ?predicateFilterValue. INCLUDE %predicateFilterValues. BIND(?predicateFilterValueRGB AS ?nodeRGB) }
} AS %nodes WITH {SELECT ?subject ?object ?edgeRGB WHERE {
INCLUDE %predicates. ?subject {{{predicate}}} ?subjectValue. ?object {{{predicate}}} ?objectValue. ?subject ?predicate ?object. # This is filtering for each edge twice, potentially a huge waste: |E|*|V| instead of |V| ?subject pdiot:P55 pdio:Q564. ?object pdiot:P55 pdio:Q564. BIND(?predicateRGB as ?edgeRGB) }
} AS %edges WHERE {
{ INCLUDE %nodes. BIND(?node AS ?item1). BIND(?nodeRGB AS ?rgb). } UNION { INCLUDE %edges. BIND(?subject AS ?item1). BIND(?object AS ?item2). BIND(?edgeRGB AS ?rgb). } SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
} LIMIT 10000