query-70fb8a488d40cea7172ccc0d56690f33

rq turtle/ttl

Records of the Auckland Museum

SELECT DISTINCT ?article ?titleLabel (GROUP_CONCAT (DISTINCT ?authorLabel; separator="; ") AS ?authors) ?metadata ?JSTOR ?DOI WHERE { # Get JSTOR URL format wd:P888 wdt:P1630 ?JSTORformat .

#Get DOI URL format wd:P356 wdt:P1630 ?DOIformat .

# Get articles "P14333" (published in) "Q15756170" (Records of the Auckland Museum) ?article wdt:P1433 wd:Q15756170.

OPTIONAL { ?article wdt:P1476 ?title. } OPTIONAL { ?article wdt:P50 ?author. } OPTIONAL { ?article wdt:P577 ?date. } OPTIONAL { ?article wdt:P478 ?vol. } OPTIONAL { ?article wdt:P304 ?pp. }
OPTIONAL { ?article wdt:P888 ?JSTOR_ID. } OPTIONAL { ?article wdt:P356 ?rawDOI. }

# Combine vol & page numbers with pub. date BIND(CONCAT("Vol. ", ?vol, "; pp. ", ?pp, ". Published ", STR(DAY(?date)), "/", STR(MONTH(?date)), "/", STR(YEAR(?date)), ".") AS ?metadata )

# Create JSTOR links BIND(IRI(REPLACE(?JSTOR_ID, "^(.+)$", ?JSTORformat)) AS ?JSTOR)

# Create DOI links BIND(IRI(REPLACE(?rawDOI, "^(.+)$", ?DOIformat)) AS ?DOI)

# Get English labels SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

GROUP BY ?article ?titleLabel ?metadata ?JSTOR ?DOI ORDER BY ?date

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Records of the Auckland Museum

SELECT DISTINCT ?article ?titleLabel
(GROUP_CONCAT (DISTINCT ?authorLabel; separator="; ") AS ?authors)
?metadata ?JSTOR ?DOI
WHERE {
  # Get JSTOR URL format
  wd:P888 wdt:P1630 ?JSTORformat .

  #Get DOI URL format
  wd:P356 wdt:P1630 ?DOIformat .

  # Get articles "P14333" (published in) "Q15756170" (Records of the Auckland Museum)
  ?article wdt:P1433 wd:Q15756170.

  OPTIONAL { ?article wdt:P1476 ?title. }
  OPTIONAL { ?article wdt:P50   ?author. }
  OPTIONAL { ?article wdt:P577  ?date. }
  OPTIONAL { ?article wdt:P478  ?vol. }
  OPTIONAL { ?article wdt:P304  ?pp. }  
  OPTIONAL { ?article wdt:P888  ?JSTOR_ID. }
  OPTIONAL { ?article wdt:P356  ?rawDOI. }

  # Combine vol & page numbers with pub. date
  BIND(CONCAT("Vol. ", ?vol, "; pp. ", ?pp, ". Published ", STR(DAY(?date)), "/",  STR(MONTH(?date)), "/", STR(YEAR(?date)), ".")
             AS ?metadata )

  # Create JSTOR links
  BIND(IRI(REPLACE(?JSTOR_ID, "^(.+)$", ?JSTORformat)) AS ?JSTOR)

  # Create DOI links
  BIND(IRI(REPLACE(?rawDOI, "^(.+)$", ?DOIformat)) AS ?DOI)

  # Get English labels
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

GROUP BY ?article ?titleLabel ?metadata ?JSTOR ?DOI
ORDER BY ?date

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v13("?DOI"):::projected v3("?DOIformat") v12("?JSTOR"):::projected v9("?JSTOR_ID") v2("?JSTORformat") v4("?article"):::projected v6("?author") v14("?authorLabel"):::projected v15("?authors") v1("?date") v11("?metadata"):::projected v8("?pp") v10("?rawDOI") v5("?title") v7("?vol") c5(["wd:Q15756170"]):::iri c3(["wd:P356"]):::iri c14(["bd:serviceParam"]):::iri c1(["wd:P888"]):::iri c16(["#91;AUTO_LANGUAGE#93;,en"]):::literal c1 --"wdt:P1630"--> v2 c3 --"wdt:P1630"--> v3 v4 --"wdt:P1433"--> c5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P1476".-> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P50".-> v6 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P577".-> v1 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P478".-> v7 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P304".-> v8 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P888".-> v9 end subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P356".-> v10 end bind0[/"concat('Vol. ',?vol,'; pp. ',?pp,'. Published ',str(day-from-dateTime(?date)),'/',str(month-from-dateTime(?date)),'/',str(year-from-dateTime(?date)),'.')"/] v7 --o bind0 v8 --o bind0 v1 --o bind0 bind0 --as--o v11 bind1[/"replace(?JSTOR_ID,'^(.+)$',?JSTORformat)"/] v9 --o bind1 v2 --o bind1 bind1 --as--o v12 bind2[/"replace(?rawDOI,'^(.+)$',?DOIformat)"/] v10 --o bind2 v3 --o bind2 bind2 --as--o v13 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 end bind4[/"?authorLabel"/] v14 --o bind4 bind4 --as--o v15