Project:SPARQL/examples: Difference between revisions

From The SHARE Catalogue mapping knowledge base
Jump to navigation Jump to search
(7 intermediate revisions by the same user not shown)
Line 2: Line 2:
<sparql tryit="1">
<sparql tryit="1">
#title: Tutti i subfield creati
#title: Tutti i subfield creati
PREFIX uni2bfwd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX wd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX uni2bfwdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>
PREFIX wdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>


SELECT ?tagLabel ?subfield ?subfieldLabel ?subfieldAltLabel ?occurrenceLabel ?repeatabilityLabel
SELECT ?tagLabel ?subfield ?subfieldLabel ?subfieldAltLabel ?occurrenceLabel ?repeatabilityLabel
WHERE
WHERE
{
{
   ?subfield uni2bfwdt:P1 uni2bfwd:Q2059 .
   ?subfield wdt:P1 wd:Q2059 .
   OPTIONAL {?subfield uni2bfwdt:P6 ?occurrence ; uni2bfwdt:P7 ?repeatability .}
   OPTIONAL {?subfield wdt:P6 ?occurrence ; wdt:P7 ?repeatability .}
   ?subfield uni2bfwdt:P4 ?tag .
   ?subfield wdt:P4 ?tag .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en,fr". }
  }
ORDER BY ?subfieldAltLabel ?subfieldLabel
</sparql>
 
===Tag con P14 (mappato in forma tabellare all'URL)===
<sparql tryit="1">
#title:Checklist dei tag con P14 (mappato in forma tabellare all'URL)
PREFIX wd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX wdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>
 
SELECT ?itemLabel ?item ?map_url
WHERE
{
  ?item wdt:P1 wd:Q125 .
  OPTIONAL {?item wdt:P14 ?map_url .}
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  }
</sparql>
===Tutti i subfield di uno specifico tag (per es. 318)===
<sparql tryit="1">
#title: Tutti i subfield di uno specifico tag (per es. 318)
PREFIX wd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX wdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>
SELECT ?tagLabel ?subfield ?subfieldLabel ?subfieldAltLabel ?occurrenceLabel ?repeatabilityLabel
WHERE
{
  ?subfield wdt:P1 wd:Q2059 .
  VALUES ?tag {wd:Q54}
  OPTIONAL {?subfield wdt:P6 ?occurrence ; wdt:P7 ?repeatability .}
  ?subfield wdt:P4 ?tag .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en,fr". }
   }
   }
ORDER BY ?subfieldAltLabel ?subfieldLabel
ORDER BY ?subfieldAltLabel ?subfieldLabel
Line 26: Line 59:
{
{
   ?item wdt:P1 wd:Q125 .
   ?item wdt:P1 wd:Q125 .
  OPTIONAL {?item wdt:P11 ?ind1 . }
  OPTIONAL {?item wdt:P12 ?ind2 . }
 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,it,fr". }
  }
ORDER BY ?itemLabel
</sparql>
===Tutti i tag con indicatore 1 e indicatore 2 uguale a "blank(not defined)"===
<sparql tryit="1">
#title:Tutti i tag con indicatore 1 e indicatore 2 uguale a "blank(not defined)"
PREFIX wd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX wdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>
SELECT ?tag ?tagLabel ?ind1Label ?ind2Label
WHERE
{
  ?tag wdt:P11 ?ind1 .
  ?tag wdt:P12 ?ind2 .
  ?tag wdt:P11 wd:Q2753 .
  ?tag wdt:P12 wd:Q2753 .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en". }
  }
ORDER BY ?tagLabel
</sparql>
===Tutti i tag che contengono la proprietà "mappato in forma tabellare"===
<sparql tryit="1">
#title: Tutti i tag che contengono la proprietà "mappato in forma tabellare"
PREFIX wd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX wdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>
SELECT ?item ?itemLabel ?TableURL
WHERE
{
  ?item wdt:P14 ?TableURL .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  }
ORDER BY ?itemLabel
</sparql>
===Tag del blocco 6-- con indicatori===
<sparql tryit="1">
#title: Tag del blocco 6-- con indicatori
PREFIX wd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX wdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>
SELECT  ?item ?itemLabel ?itemDescription ?ind1Label ?ind2Label
WHERE
{
  ?item wdt:P1 wd:Q125 .
  ?item wdt:P4 wd:Q90 .
   OPTIONAL {?item wdt:P11 ?ind1 . }
   OPTIONAL {?item wdt:P11 ?ind1 . }
   OPTIONAL {?item wdt:P12 ?ind2 . }
   OPTIONAL {?item wdt:P12 ?ind2 . }
Line 117: Line 201:
{
{
   ?item uni2bfwdt:P7 uni2bfwd:Q22 ;
   ?item uni2bfwdt:P7 uni2bfwd:Q22 ;
         uni2bfwdt:P6 ?occurrence .
         uni2bfwdt:P6 ?occurrence ;
uni2bfwdt:P1 uni2bfwd:Q125 .
    
    
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

Revision as of 11:13, 19 November 2024

Tutti i sottocampi creati

#title: Tutti i subfield creati
PREFIX wd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX wdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>

SELECT ?tagLabel ?subfield ?subfieldLabel ?subfieldAltLabel ?occurrenceLabel ?repeatabilityLabel
WHERE
{
  ?subfield wdt:P1 wd:Q2059 .
  OPTIONAL {?subfield wdt:P6 ?occurrence ; wdt:P7 ?repeatability .}
  ?subfield wdt:P4 ?tag .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en,fr". }
  }
ORDER BY ?subfieldAltLabel ?subfieldLabel

Try it!


Tag con P14 (mappato in forma tabellare all'URL)

#title:Checklist dei tag con P14 (mappato in forma tabellare all'URL)
PREFIX wd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX wdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>

SELECT ?itemLabel ?item ?map_url 
WHERE
{
  ?item wdt:P1 wd:Q125 .
  OPTIONAL {?item wdt:P14 ?map_url .}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  }

Try it!


Tutti i subfield di uno specifico tag (per es. 318)

#title: Tutti i subfield di uno specifico tag (per es. 318)
PREFIX wd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX wdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>

SELECT ?tagLabel ?subfield ?subfieldLabel ?subfieldAltLabel ?occurrenceLabel ?repeatabilityLabel
WHERE
{
  ?subfield wdt:P1 wd:Q2059 .
  VALUES ?tag {wd:Q54} 
  OPTIONAL {?subfield wdt:P6 ?occurrence ; wdt:P7 ?repeatability .}
  ?subfield wdt:P4 ?tag .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en,fr". }
  }
ORDER BY ?subfieldAltLabel ?subfieldLabel

Try it!


Tutti i tag con gli indicatori (quando presenti)

#title: Tutti i tag con la descrizione degli indicatori, quando presenti
PREFIX wd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX wdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>

SELECT  ?item ?itemLabel ?itemDescription ?ind1Label ?ind2Label
WHERE
{
  ?item wdt:P1 wd:Q125 .
  OPTIONAL {?item wdt:P11 ?ind1 . }
  OPTIONAL {?item wdt:P12 ?ind2 . }
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,it,fr". }
  }
ORDER BY ?itemLabel

Try it!


Tutti i tag con indicatore 1 e indicatore 2 uguale a "blank(not defined)"

#title:Tutti i tag con indicatore 1 e indicatore 2 uguale a "blank(not defined)"
PREFIX wd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX wdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>

SELECT ?tag ?tagLabel ?ind1Label ?ind2Label 
WHERE
{
  ?tag wdt:P11 ?ind1 .
  ?tag wdt:P12 ?ind2 .
  ?tag wdt:P11 wd:Q2753 .
  ?tag wdt:P12 wd:Q2753 .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en". }
  }
ORDER BY ?tagLabel

Try it!


Tutti i tag che contengono la proprietà "mappato in forma tabellare"

#title: Tutti i tag che contengono la proprietà "mappato in forma tabellare"
PREFIX wd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX wdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>
SELECT ?item ?itemLabel ?TableURL 
WHERE
{
  ?item wdt:P14 ?TableURL .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  }
ORDER BY ?itemLabel

Try it!


Tag del blocco 6-- con indicatori

#title: Tag del blocco 6-- con indicatori
PREFIX wd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX wdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>

SELECT  ?item ?itemLabel ?itemDescription ?ind1Label ?ind2Label
WHERE
{
  ?item wdt:P1 wd:Q125 .
  ?item wdt:P4 wd:Q90 .
  OPTIONAL {?item wdt:P11 ?ind1 . }
  OPTIONAL {?item wdt:P12 ?ind2 . }
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,it,fr". }
  }
ORDER BY ?itemLabel

Try it!


Tutti gli item dove per occorrenza (P6) è presente una condizione (P8)

PREFIX wd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX wdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>
PREFIX p: <https://unimarc2bibframe.wikibase.cloud/prop/> 
PREFIX ps: <https://unimarc2bibframe.wikibase.cloud/prop/statement/> 
PREFIX psv: <https://unimarc2bibframe.wikibase.cloud/prop/statement/value/> 
PREFIX psn: <https://unimarc2bibframe.wikibase.cloud/prop/statement/value-normalized/> 
PREFIX pq: <https://unimarc2bibframe.wikibase.cloud/prop/qualifier/>
PREFIX pqv: <https://unimarc2bibframe.wikibase.cloud/prop/qualifier/value/> 
PREFIX pqn: <https://unimarc2bibframe.wikibase.cloud/prop/qualifier/value-normalized/> 
PREFIX pr: <https://unimarc2bibframe.wikibase.cloud/prop/reference/> 
PREFIX prv: <https://unimarc2bibframe.wikibase.cloud/prop/reference/value/> 
PREFIX prn: <https://unimarc2bibframe.wikibase.cloud/prop/reference/value-normalized/> 

SELECT ?item ?itemtypeLabel ?itemLabel ?itemAltLabel ?occurrenceLabel ?requirementLabel
WHERE
{
 ?item wdt:P1 ?itemtype . 
 ?item p:P6 [ps:P6 ?occurrence;
               pq:P8 ?requirement;].
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
  }

Try it!

Tutti gli elementi che contengono P5(aggiornamento utilizzato) ordinati per numero di dichiarazioni

#title: Tutti gli elementi che contengono P5(aggiornamento utilizzato) ordinati per numero di dichiarazioni decrescente
PREFIX uni2bfwd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX uni2bfwdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>

select ?item ?itemLabel ?itemDescription ?itemAltLabel ?update_year ?statements
WHERE
{
  ?item uni2bfwdt:P5 ?update_used .
  ?item wikibase:statements ?statements .
  BIND(YEAR(?update_used) as ?update_year)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
  }
ORDER BY DESC (?statements)

Try it!


Tag senza Aggiornamento utilizzato (P5)

#title: Tag che non contengono P5(aggiornamento utilizzato)
PREFIX uni2bfwd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX uni2bfwdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>

select ?item ?itemLabel
WHERE
{
  ?item uni2bfwdt:P1 uni2bfwd:Q125 . 
  MINUS {?item uni2bfwdt:P5 ?update_used .}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,fr,en". }
  }
ORDER BY ?itemLabel

Try it!


Tag del blocco 5-- senza Aggiornamento utilizzato (P5)

#title: Tag blocco 5-- senza Aggionramento utilizzato (P5)
PREFIX uni2bfwd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX uni2bfwdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>

SELECT  ?item ?itemLabel ?itemDescription
WHERE
{
  ?item uni2bfwdt:P4 uni2bfwd:Q89 .
  MINUS {?item uni2bfwdt:P5 ?update .}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,fr,it". }
  }
ORDER BY ?item

Try it!


Tutti i tag non ripetibili con relativa occorrenza(P6)

#title: Tutti i tag non ripetibili con relativa occorrenza(P6)
PREFIX uni2bfwd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX uni2bfwdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>

SELECT  ?item ?itemLabel ?itemDescription ?occurrenceLabel
WHERE
{
  ?item uni2bfwdt:P7 uni2bfwd:Q22 ;
        uni2bfwdt:P6 ?occurrence ;
uni2bfwdt:P1 uni2bfwd:Q125 .
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  }

Try it!


Tutti i tag del blocco 0-- con indicatori

#title: Tutti i tag del blocco 0-- con la descrizione degli indicatori (quando presenti)
PREFIX uni2bfwd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX uni2bfwdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>

SELECT  ?item ?itemLabel ?itemDescription ?ind1Label ?ind2Label ?occurrenceLabel ?repeatabilityLabel ?update_year
WHERE
{
  ?item uni2bfwdt:P4 uni2bfwd:Q1 .
  OPTIONAL {?item uni2bfwdt:P11 ?ind1 . }
  OPTIONAL {?item uni2bfwdt:P12 ?ind2 . }
  OPTIONAL {?item uni2bfwdt:P6 ?occurrence .}
  OPTIONAL {?item uni2bfwdt:P7 ?repeatability .}
  OPTIONAL {?item uni2bfwdt:P5 ?update_used .}
  BIND(YEAR(?update_used) as ?update_year)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,fr,it". }
  }
ORDER BY ?itemLabel

Try it!


Tutti i subfield del tag 210

#title: Tutti i subfield del tag 210 (Q2029)
PREFIX uni2bfwd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX uni2bfwdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>

SELECT ?tag ?tagLabel ?subfield ?subfieldLabel ?repeatabilityLabel
WHERE
{
  ?subfield uni2bfwdt:P4 uni2bfwd:Q2029;
            uni2bfwdt:P7 ?repeatability.
  ?tag uni2bfwdt:P3 ?subfield .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  }

Try it!


Aggiornamenti dei tag del blocco 2-- come timeline

#defaultView:Timeline
#title: Timeline aggiornamenti dei tag del blocco 2--
PREFIX uni2bfwd: <https://unimarc2bibframe.wikibase.cloud/entity/>
PREFIX uni2bfwdt: <https://unimarc2bibframe.wikibase.cloud/prop/direct/>

SELECT  ?itemLabel ?update_used
WHERE
{
  ?item uni2bfwdt:P4 uni2bfwd:Q12 .
  OPTIONAL {?item uni2bfwdt:P6 ?occurrence .}
  OPTIONAL {?item uni2bfwdt:P7 ?repeatability .}
  OPTIONAL {?item uni2bfwdt:P5 ?update_used .}
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,fr,it". }
  }
ORDER BY ?item

Try it!