Przejdź do zawartości

KHW:SPARQL examples

Z Arcarium Index

Przykłady

Wszystkie osoby w wiki

PREFIX wd:  <https://arcarium.index.bj.uj.edu.pl/entity/>
PREFIX wdt: <https://arcarium.index.bj.uj.edu.pl/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?person ?label
WHERE {
  ?person wdt:P1 wd:Q2 .

  OPTIONAL {
    ?person rdfs:label ?label .
    FILTER(LANG(?label) = "mul")
  }
}
ORDER BY ?label

Wypróbuj!


Wszyscy politycy

PREFIX wd:   <https://arcarium.index.bj.uj.edu.pl/entity/>
PREFIX wdt:  <https://arcarium.index.bj.uj.edu.pl/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?person ?label
WHERE {
  ?person wdt:P1 wd:Q2 .
  ?person wdt:P20 wd:Q35911 .

  OPTIONAL {
    ?person rdfs:label ?label .
    FILTER(LANG(?label) = "mul")
  }
}
ORDER BY ?label

Wypróbuj!

Ciała zbiorowe które były aktywne w XIX wieku

PREFIX wd:   <https://arcarium.index.bj.uj.edu.pl/entity/>
PREFIX wdt:  <https://arcarium.index.bj.uj.edu.pl/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?institution ?label ?activityStart ?activityEnd
WHERE {
  ?institution wdt:P1 wd:Q13168 .

  OPTIONAL {
    ?institution wdt:P22 ?activityStart .
  }

  OPTIONAL {
    ?institution wdt:P23 ?activityEnd .
  }

  OPTIONAL {
    ?institution rdfs:label ?label .
    FILTER(LANG(?label) = "mul")
  }

  FILTER(
    (BOUND(?activityStart) || BOUND(?activityEnd)) &&
    (!BOUND(?activityStart) || YEAR(?activityStart) <= 1900) &&
    (!BOUND(?activityEnd)   || YEAR(?activityEnd) >= 1801)
  )
}
ORDER BY ?label

Wypróbuj!

Obiekty dLibry w których autorem jest kobieta

PREFIX ds:   <https://arcarium.manuscripta.bj.uj.edu.pl/subject/>
PREFIX dp:   <https://arcarium.manuscripta.bj.uj.edu.pl/predicate/>

PREFIX wd:   <https://arcarium.index.bj.uj.edu.pl/entity/>
PREFIX wdt:  <https://arcarium.index.bj.uj.edu.pl/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dc:   <http://purl.org/dc/elements/1.1/>

SELECT DISTINCT ?dlibraLink ?title ?creator ?creatorLabel
WHERE {
  ?dlibraObject dp:creator ?creator .

  ?creator wdt:P15 wd:Q6 .

  OPTIONAL {
    ?dlibraObject dp:title ?title .
  }

  OPTIONAL {
    ?creator rdfs:label ?creatorLabel .
    FILTER(LANG(?creatorLabel) = "mul")
  }

  ?dlibraObject dc:identifier ?dlibraLink .

  FILTER(
    STRSTARTS(STR(?dlibraObject), STR(ds:)) &&
    STRSTARTS(
      STR(?dlibraLink),
      "https://arcarium.manuscripta.bj.uj.edu.pl/dlibra/"
    )
  )
}
ORDER BY ?creatorLabel ?title

Wypróbuj!

Karty ze sztambucha autorstwa mężczyzn

PREFIX ds:   <https://arcarium.manuscripta.bj.uj.edu.pl/subject/>
PREFIX dp:   <https://arcarium.manuscripta.bj.uj.edu.pl/predicate/>

PREFIX wd:   <https://arcarium.index.bj.uj.edu.pl/entity/>
PREFIX wdt:  <https://arcarium.index.bj.uj.edu.pl/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dc:   <http://purl.org/dc/elements/1.1/>

SELECT DISTINCT ?dlibraLink ?title ?creator ?creatorLabel
WHERE {
  ?dlibraObject dp:creator ?creator .
  ?dlibraObject dp:documenttype "karta ze sztambucha" .

  ?creator wdt:P15 wd:Q5 .

  OPTIONAL {
    ?dlibraObject dp:title ?title .
  }

  OPTIONAL {
    ?creator rdfs:label ?creatorLabel .
    FILTER(LANG(?creatorLabel) = "mul")
  }

  ?dlibraObject dc:identifier ?dlibraLink .

  FILTER(
    STRSTARTS(STR(?dlibraObject), STR(ds:)) &&
    STRSTARTS(
      STR(?dlibraLink),
      "https://arcarium.manuscripta.bj.uj.edu.pl/dlibra/"
    )
  )
}
ORDER BY ?creatorLabel ?title

Wypróbuj!

Publikacje z miejscem powiązanym z Arcarium Index

PREFIX ds:   <https://arcarium.manuscripta.bj.uj.edu.pl/subject/>
PREFIX dp:   <https://arcarium.manuscripta.bj.uj.edu.pl/predicate/>

PREFIX wd:   <https://arcarium.index.bj.uj.edu.pl/entity/>
PREFIX wdt:  <https://arcarium.index.bj.uj.edu.pl/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dc:   <http://purl.org/dc/elements/1.1/>

SELECT DISTINCT ?dlibraLink ?title ?place ?placeLabel
WHERE {
  ?dlibraObject dp:location ?place .

  ?place wdt:P1 wd:Q10 .

  OPTIONAL {
    ?dlibraObject dp:title ?title .
  }

  OPTIONAL {
    ?place rdfs:label ?placeLabel .
    FILTER(LANG(?placeLabel) = "mul")
  }

  ?dlibraObject dc:identifier ?dlibraLink .

  FILTER(
    STRSTARTS(STR(?dlibraObject), STR(ds:)) &&
    STRSTARTS(STR(?place), STR(wd:)) &&
    STRSTARTS(
      STR(?dlibraLink),
      "https://arcarium.manuscripta.bj.uj.edu.pl/dlibra/"
    )
  )
}
ORDER BY ?placeLabel ?title

Wypróbuj!