Project:SPARQL/examples: Difference between revisions
Jump to navigation
Jump to search
Tdkiv-admin (talk | contribs) No edit summary |
Tdkiv-admin (talk | contribs) No edit summary |
||
Line 22: | Line 22: | ||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | PREFIX owl: <http://www.w3.org/2002/07/owl#> | ||
PREFIX prov: <http://www.w3.org/ns/prov#> | PREFIX prov: <http://www.w3.org/ns/prov#> | ||
SELECT ?zdroj ?stitek (COUNT(?zdroj) AS ?pocet_citaci) WHERE { | SELECT DISTINCT ?zdroj ?stitek (COUNT(?zdroj) AS ?pocet_citaci) WHERE { | ||
?item zp:P1 ?vykladstatement. | ?item zp:P1 ?vykladstatement. | ||
?vykladstatement zps:P1 ?vyklad; | ?vykladstatement zps:P1 ?vyklad; | ||
Line 34: | Line 34: | ||
?zdroj owl:sameAs ?presmerovany_zdroj. | ?zdroj owl:sameAs ?presmerovany_zdroj. | ||
?presmerovany_zdroj rdfs:label ?presmerovany_label. | ?presmerovany_zdroj rdfs:label ?presmerovany_label. | ||
FILTER((LANG(?presmerovany_label)) = "cs") | |||
} | } | ||
BIND(IF(BOUND(?presmerovany_label), ?presmerovany_label, ?zdrojLabel) AS ?stitek) | BIND(IF(BOUND(?presmerovany_label), ?presmerovany_label, ?zdrojLabel) AS ?stitek) | ||
} | } | ||
GROUP BY ?zdroj ?zdrojLabel ?presmerovany_zdroj ?presmerovany_label ?stitek | GROUP BY ?zdroj ?zdrojLabel ?presmerovany_zdroj ?presmerovany_label ?stitek ?pocet_citaci | ||
ORDER BY DESC (?pocet_citaci) | ORDER BY DESC (?pocet_citaci) | ||
</sparql> | </sparql> |
Revision as of 05:29, 27 September 2024
Vzorové dotazy
Všechny pojmy s výkladem
PREFIX zwb: <https://tdkiv.wikibase.cloud/entity/>
PREFIX zdp: <https://tdkiv.wikibase.cloud/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?vyklad WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "cs,en". }
?item zdp:P16 zwb:Q4397;
zdp:P1 ?vyklad.
}
ORDER BY (?itemLabel)
Počty citací použitých zdrojů
#defaultView:BubbleChart
PREFIX zp: <https://tdkiv.wikibase.cloud/prop/>
PREFIX zps: <https://tdkiv.wikibase.cloud/prop/statement/>
PREFIX zpr: <https://tdkiv.wikibase.cloud/prop/reference/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX prov: <http://www.w3.org/ns/prov#>
SELECT DISTINCT ?zdroj ?stitek (COUNT(?zdroj) AS ?pocet_citaci) WHERE {
?item zp:P1 ?vykladstatement.
?vykladstatement zps:P1 ?vyklad;
prov:wasDerivedFrom ?ref.
?ref zpr:P22 ?zdroj.
OPTIONAL {
?zdroj rdfs:label ?zdrojLabel.
FILTER((LANG(?zdrojLabel)) = "cs")
}
OPTIONAL {
?zdroj owl:sameAs ?presmerovany_zdroj.
?presmerovany_zdroj rdfs:label ?presmerovany_label.
FILTER((LANG(?presmerovany_label)) = "cs")
}
BIND(IF(BOUND(?presmerovany_label), ?presmerovany_label, ?zdrojLabel) AS ?stitek)
}
GROUP BY ?zdroj ?zdrojLabel ?presmerovany_zdroj ?presmerovany_label ?stitek ?pocet_citaci
ORDER BY DESC (?pocet_citaci)