query-6d0dfecdb75a05db9f5a454742bc2213

rq turtle/ttl

FANAC, Fancyclopedia, eFanzines cross-ref

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?itemLabel ?sfnal ?efanzines ?fancy ?fanac WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul"}

        {?item wdt:P9307 ?a}            # Fancyclopedia ID
  UNION {?item wdt:P1343 wd:Q5323019}   # eFanzines
  UNION {?item wdt:P1343 wd:Q112954537} # Fanac

  BIND (CONCAT("https://sfnal.info/",REPLACE(STR(?item), "http://www.wikidata.org/entity/","")) AS ?sfnal)

  OPTIONAL {?item wdt:P9307 ?temp2. BIND (CONCAT("https://fancyclopedia.org/",STR(?temp2)) AS ?fancy)}
  OPTIONAL {?item p:P1343 ?temp3.
            ?temp3 ps:P1343 wd:Q5323019; pq:P2699 ?efanzines}
  OPTIONAL {?item p:P1343 ?temp4.
            ?temp4 ps:P1343 wd:Q112954537; pq:P2699 ?fanac}
}
ORDER BY ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?a") v8("?efanzines"):::projected v10("?fanac"):::projected v6("?fancy"):::projected v2("?item") v1("?itemLabel"):::projected v4("?sfnal"):::projected v5("?temp2") v7("?temp3") v9("?temp4") c4(["en-gb,en,mul"]):::literal c7(["wd:Q5323019"]):::iri c2(["bd:serviceParam"]):::iri c8(["wd:Q112954537"]):::iri subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P1343"--> c8 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P1343"--> c7 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P9307"--> v3 end union0r <== or ==> union0l end bind0[/"concat('https://sfnal.info/',replace(str(?item),'http://www.wikidata.org/entity/',''))"/] v2 --o bind0 bind0 --as--o v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P9307".-> v5 bind1[/"concat('https://fancyclopedia.org/',str(?temp2))"/] v5 --o bind1 bind1 --as--o v6 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P1343".-> v7 v7 --"p:statement/P1343"--> c7 v7 --"p:qualifier/P2699"--> v8 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P1343".-> v9 v9 --"p:statement/P1343"--> c8 v9 --"p:qualifier/P2699"--> v10 end