query sul nuovo grafo

This commit is contained in:
cesare 2022-11-07 15:10:43 +01:00
parent fff18f5d33
commit 75b2e67f05
2 changed files with 21 additions and 20 deletions

View File

@ -8,6 +8,7 @@
body { body {
font-family: Georgia, "Times New Roman", Times, serif; font-family: Georgia, "Times New Roman", Times, serif;
color: #555; color: #555;
overscroll-behavior: none;
} }
h1, .h1, h1, .h1,

View File

@ -6,14 +6,14 @@ PREFIX ontolex: <http://www.w3.org/ns/lemon/ontolex#>
PREFIX olires: <https://dantenetwork.it/ontology/OLIRes/> PREFIX olires: <https://dantenetwork.it/ontology/OLIRes/>
PREFIX comm: <http://dantenetwork.it/data/commedia/> PREFIX comm: <http://dantenetwork.it/data/commedia/>
SELECT (?form AS ?IRIForma) (?Rappresentazione AS ?Forma) (?lm AS ?Lemma) (?textver AS ?Verso) (?NumVerso AS ?NumeroVerso) (?t_canto AS ?Canto) (?t_cantica AS ?Cantica) WHERE { SELECT (?form AS ?IRIForma) (?Rappresentazione AS ?Forma) (?lm AS ?Lemma) (?textver AS ?Verso) (?NumVerso AS ?NumeroVerso) (?t_canto AS ?Canto) (?t_cantica AS ?Cantica) WHERE {
?fa orl:occurrenceOf ?form; ?fa orl:occurrenceOf ?form .
ecrm:P148i_is_component_of ?ver. ?ver olires:hasStructuralComponent ?fa .
?ver ecrm:P190_Has_Symbolic_Content ?textver; ?ver ecrm:P190_Has_Symbolic_Content ?textver;
olires:hasNumber ?NumVerso; olires:hasNumber ?NumVerso.
ecrm:P148i_is_component_of ?canto.
?canto ecrm:P102_has_title ?t_canto; ?canto ecrm:P102_has_title ?t_canto;
ecrm:P148i_is_component_of ?cantica. hasStructuralComponent ?ver.
?cantica ecrm:P102_has_title ?t_cantica. ?cantica ecrm:P102_has_title ?t_cantica ;
hasStructuralComponent ?canto .
?form ontolex:writtenRep ?Rappresentazione. ?form ontolex:writtenRep ?Rappresentazione.
?lent ontolex:lexicalForm ?form; ?lent ontolex:lexicalForm ?form;
ontolex:canonicalForm ?cf. ontolex:canonicalForm ?cf.
@ -44,14 +44,14 @@ PREFIx comm: <https://dantenetwork.it/data/commedia/>
SELECT (?form AS ?IRIForma) (?Rappresentazione AS ?Forma) (?lm AS ?Lemma) (?textver AS ?Verso) (?NumVerso AS ?NumeroVerso) (?t_canto AS ?Canto) (?t_cantica AS ?Cantica) SELECT (?form AS ?IRIForma) (?Rappresentazione AS ?Forma) (?lm AS ?Lemma) (?textver AS ?Verso) (?NumVerso AS ?NumeroVerso) (?t_canto AS ?Canto) (?t_cantica AS ?Cantica)
(?textver1 AS ?VersoPrec) (?textver2 AS ?VersoSucc) (?textver1 AS ?VersoPrec) (?textver2 AS ?VersoSucc)
WHERE { WHERE {
?fa orl:occurrenceOf ?form; ?fa orl:occurrenceOf ?form.
ecrm:P148i_is_component_of ?ver.
?ver ecrm:P190_Has_Symbolic_Content ?textver; ?ver ecrm:P190_Has_Symbolic_Content ?textver;
olires:hasNumber ?NumVerso; olires:hasNumber ?NumVerso;
ecrm:P148i_is_component_of ?canto. olires:hasStructuralComponent ?fa.
?canto ecrm:P102_has_title ?t_canto; ?canto ecrm:P102_has_title ?t_canto;
ecrm:P148i_is_component_of ?cantica. olires:hasStructuralComponent ?ver.
?cantica ecrm:P102_has_title ?t_cantica. ?cantica ecrm:P102_has_title ?t_cantica;
olires:hasStructuralComponent ?canto.
?form ontolex:writtenRep ?Rappresentazione. ?form ontolex:writtenRep ?Rappresentazione.
?lent ontolex:lexicalForm ?form; ?lent ontolex:lexicalForm ?form;
ontolex:canonicalForm ?cf. ontolex:canonicalForm ?cf.
@ -63,16 +63,16 @@ WHERE {
BIND(xsd:short(?NumVerso+1) as ?NumVerso2) BIND(xsd:short(?NumVerso+1) as ?NumVerso2)
Optional{ Optional{
?ver1 ecrm:P190_Has_Symbolic_Content ?textver1; ?ver1 ecrm:P190_Has_Symbolic_Content ?textver1;
olires:hasNumber ?NumVerso1; olires:hasNumber ?NumVerso1.
ecrm:P148i_is_component_of ?canto. ?canto olires:hasStructuralComponent ?ver1 .
} }
OPTIONAL { OPTIONAL {
?ver2 ecrm:P190_Has_Symbolic_Content ?textver2; ?ver2 ecrm:P190_Has_Symbolic_Content ?textver2;
olires:hasNumber ?NumVerso2; olires:hasNumber ?NumVerso2.
ecrm:P148i_is_component_of ?canto. ?canto olires:hasStructuralComponent ?ver2 .
} }
} ORDER BY (?canto) (?cantica) } ORDER BY (?canto) (?cantica)
LIMIT 10 LIMIT 20
` `
// Per restituire i versi di una cantica // Per restituire i versi di una cantica
@ -89,13 +89,13 @@ var qVersiCantica=`
WHERE { WHERE {
?ver ecrm:P190_Has_Symbolic_Content ?textver; ?ver ecrm:P190_Has_Symbolic_Content ?textver;
olires:hasNumber ?NumVerso; olires:hasNumber ?NumVerso;
olires:OccursInRegion ?reg; olires:OccursInRegion ?reg .
ecrm:P148i_is_component_of ?canto.
?reg olires:fragmentRegionFrom ?from; ?reg olires:fragmentRegionFrom ?from;
olires:fragmentRegionTo ?to . olires:fragmentRegionTo ?to .
?canto ecrm:P102_has_title ?t_canto; ?canto ecrm:P102_has_title ?t_canto;
ecrm:P148i_is_component_of ?cantica. olires:hasStructuralComponent ?ver.
?cantica ecrm:P102_has_title ?t_cantica. ?cantica ecrm:P102_has_title ?t_cantica ;
olires:hasStructuralComponent ?canto.
FILTER regex(?t_cantica,"Inferno","i") . FILTER regex(?t_cantica,"Inferno","i") .
}` }`