Templates and SPARQL requests for rubrics, elenph excerpts and articles
This commit is contained in:
parent
6b7092a4d5
commit
63a187fea3
12 changed files with 921 additions and 0 deletions
|
@ -0,0 +1,19 @@
|
|||
@prefix : <http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#> .
|
||||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
||||
|
||||
:vivodocumentModifier_openAccess
|
||||
a <java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.SelectQueryDocumentModifier> ,
|
||||
<java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.DocumentModifier> ;
|
||||
rdfs:label "Elenph article excerpts" ;
|
||||
:hasTargetField "ALLTEXT" ;
|
||||
:hasSelectQuery """
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX ts_: <https://iph.ras.ru/text_structures#>
|
||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
||||
SELECT DISTINCT ?elenphExcerpt ?property ?value
|
||||
WHERE {
|
||||
?uri rdf:type ts_:elenphArticle .
|
||||
?uri (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?elenphExcerpt .
|
||||
?elenphExcerpt ?property ?value .
|
||||
}
|
||||
""" .
|
|
@ -0,0 +1,108 @@
|
|||
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
||||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
||||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
||||
@prefix vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> .
|
||||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
||||
@prefix ts_: <https://iph.ras.ru/text_structures#> .
|
||||
@prefix display: <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#> .
|
||||
|
||||
|
||||
<https://iph.ras.ru/text_structures#elenphArticle> display:hasDataGetter display:getArticleExcerptsContentDataGetter .
|
||||
|
||||
<https://iph.ras.ru/text_structures#elenphArticle> display:hasDataGetter display:getArticleExcerptPathsDataGetter .
|
||||
|
||||
<https://iph.ras.ru/text_structures#elenphArticle> display:hasDataGetter display:getArticleWorksDataGetter .
|
||||
|
||||
<https://iph.ras.ru/text_structures#elenphArticle> display:hasDataGetter display:getArticleBibliographyDataGetter .
|
||||
|
||||
<https://iph.ras.ru/text_structures#elenphArticle> display:hasDataGetter display:getArticleAuthorsDataGetter .
|
||||
|
||||
display:getArticleExcerptsContentDataGetter
|
||||
a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter>;
|
||||
display:saveToVar "excerpts";
|
||||
display:query
|
||||
"""
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX ts_: <https://iph.ras.ru/text_structures#>
|
||||
SELECT ?elenphExcerpt ?property ?value
|
||||
WHERE {
|
||||
?individualURI (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?elenphExcerpt .
|
||||
?elenphExcerpt ?property ?value .
|
||||
} ORDER BY ?elenphExcerpt
|
||||
""" .
|
||||
|
||||
display:getArticleExcerptPathsDataGetter
|
||||
a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter>;
|
||||
display:saveToVar "paths";
|
||||
display:query
|
||||
"""
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
||||
PREFIX ts_: <https://iph.ras.ru/text_structures#>
|
||||
SELECT (GROUP_CONCAT(substr(concat("000",str(?outline)),strlen(str(?outline))); SEPARATOR = ".") AS ?path ) ?tocElement ?elenphExcerpt
|
||||
WHERE {
|
||||
?individualURI ts_:hasTOCItem/(ts_:pointsTo/ts_:hasTOCItem)* ?tmpTOCItem .
|
||||
?tmpTOCItem rdf:type ts_:TOCItem .
|
||||
?tmpTOCItem ts_:pointsTo/(ts_:hasTOCItem/ts_:pointsTo)* ?tocElement .
|
||||
?tmpTOCItem ts_:itemNumber ?outline .
|
||||
OPTIONAL {
|
||||
?tocElement ts_:hasText ?elenphExcerpt .
|
||||
}
|
||||
{
|
||||
SELECT ?elenphArticle ?tocElement
|
||||
WHERE {
|
||||
?individualURI (ts_:hasTOCItem/ts_:pointsTo)+ ?tocElement .
|
||||
?tocElement rdf:type ts_:TOCElement .
|
||||
?individualURI rdf:type ts_:elenphArticle .
|
||||
}
|
||||
}
|
||||
} GROUP BY ?tocElement ?elenphExcerpt ORDER BY ?path
|
||||
""" .
|
||||
|
||||
display:getArticleBibliographyDataGetter
|
||||
a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter>;
|
||||
display:saveToVar "bibliography";
|
||||
display:query
|
||||
"""
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX ts_: <https://iph.ras.ru/text_structures#>
|
||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
||||
SELECT DISTINCT ?bibliography
|
||||
WHERE {
|
||||
?individualURI (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?elenphExcerpt .
|
||||
?elenphExcerpt ts_:bibliography ?bibliography .
|
||||
} ORDER BY ?bibliography
|
||||
""" .
|
||||
|
||||
display:getArticleWorksDataGetter
|
||||
a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter>;
|
||||
display:saveToVar "works";
|
||||
display:query
|
||||
"""
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX ts_: <https://iph.ras.ru/text_structures#>
|
||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
||||
SELECT DISTINCT ?works
|
||||
WHERE {
|
||||
?individualURI (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?elenphExcerpt .
|
||||
?elenphExcerpt ts_:works ?works .
|
||||
} ORDER BY ?works
|
||||
""" .
|
||||
|
||||
display:getArticleAuthorsDataGetter
|
||||
a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter>;
|
||||
display:saveToVar "authors";
|
||||
display:query
|
||||
"""
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX ts_: <https://iph.ras.ru/text_structures#>
|
||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
||||
SELECT DISTINCT ?author
|
||||
WHERE {
|
||||
?individualURI (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?elenphExcerpt .
|
||||
?elenphExcerpt ts_:author ?author .
|
||||
} ORDER BY ?author
|
||||
""" .
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
||||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
||||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
||||
@prefix vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> .
|
||||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
||||
@prefix ts_: <https://iph.ras.ru/text_structures#> .
|
||||
@prefix display: <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#> .
|
||||
|
||||
|
||||
<https://iph.ras.ru/relationships#rubric> display:hasDataGetter display:getArticlesWithRubricDataGetter .
|
||||
|
||||
<https://iph.ras.ru/relationships#rubric> display:hasDataGetter display:getArticlesWithChildRubricDataGetter .
|
||||
|
||||
<https://iph.ras.ru/relationships#rubric> display:hasDataGetter display:getChildRubricsDataGetter .
|
||||
|
||||
<https://iph.ras.ru/relationships#rubric> display:hasDataGetter display:getExcerptsWithRubricDataGetter .
|
||||
|
||||
<https://iph.ras.ru/relationships#rubric> display:hasDataGetter display:getExcerptsWithRubricsChildsDataGetter .
|
||||
|
||||
display:getArticlesWithChildRubricDataGetter
|
||||
a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter>;
|
||||
display:saveToVar "childArticles";
|
||||
display:query
|
||||
"""
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
||||
PREFIX ts_: <https://iph.ras.ru/text_structures#>
|
||||
PREFIX pr: <https://iph.ras.ru/relationships#>
|
||||
SELECT DISTINCT ?childArticleID ?childArticleName
|
||||
WHERE {
|
||||
?rubric (pr:hasParent)+ ?individualURI .
|
||||
?excerpt pr:belongsTo ?rubric .
|
||||
?excerpt rdf:type ts_:elenphExcerpt .
|
||||
?childArticleID (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?excerpt .
|
||||
?childArticleID rdfs:label ?childArticleName .
|
||||
?childArticleID rdf:type ts_:elenphArticle .
|
||||
} ORDER BY ?childArticleName
|
||||
""" .
|
||||
|
||||
|
||||
display:getArticlesWithRubricDataGetter
|
||||
a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter>;
|
||||
display:saveToVar "articles";
|
||||
display:query
|
||||
"""
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
||||
PREFIX ts_: <https://iph.ras.ru/text_structures#>
|
||||
PREFIX pr: <https://iph.ras.ru/relationships#>
|
||||
SELECT DISTINCT ?articleID ?articleName
|
||||
WHERE {
|
||||
?excerpt pr:belongsTo ?individualURI .
|
||||
?excerpt rdf:type ts_:elenphExcerpt .
|
||||
?articleID (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?excerpt .
|
||||
?articleID rdfs:label ?articleName .
|
||||
?articleID rdf:type ts_:elenphArticle .
|
||||
} ORDER BY ?articleName
|
||||
""" .
|
||||
|
||||
display:getChildRubricsDataGetter
|
||||
a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter>;
|
||||
display:saveToVar "childRubrics";
|
||||
display:query
|
||||
"""
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
||||
PREFIX ts_: <https://iph.ras.ru/text_structures#>
|
||||
PREFIX pr: <https://iph.ras.ru/relationships#>
|
||||
SELECT DISTINCT ?rubricID ?rubricName
|
||||
WHERE {
|
||||
?rubricID pr:hasParent ?individualURI .
|
||||
?rubricID pr:rubricOrder ?order .
|
||||
?rubricID rdfs:label ?rubricName .
|
||||
?rubricID rdf:type pr:rubric .
|
||||
} ORDER BY ?order
|
||||
""" .
|
||||
|
||||
display:getExcerptsWithRubricsChildsDataGetter
|
||||
a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter>;
|
||||
display:saveToVar "childExcerpts";
|
||||
display:query
|
||||
"""
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
||||
PREFIX ts_: <https://iph.ras.ru/text_structures#>
|
||||
PREFIX pr: <https://iph.ras.ru/relationships#>
|
||||
SELECT DISTINCT ?childExcerptID ?childExcerptName
|
||||
WHERE {
|
||||
?tmpChildRubrics (pr:hasParent)+ ?individualURI .
|
||||
?childExcerptID pr:belongsTo ?tmpChildRubrics .
|
||||
?childExcerptID rdfs:label ?childExcerptName .
|
||||
?childExcerptID rdf:type ts_:elenphExcerpt .
|
||||
} ORDER BY ?childExcerptName
|
||||
""" .
|
||||
|
||||
display:getExcerptsWithRubricDataGetter
|
||||
a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter>;
|
||||
display:saveToVar "excerpts";
|
||||
display:query
|
||||
"""
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
||||
PREFIX ts_: <https://iph.ras.ru/text_structures#>
|
||||
PREFIX pr: <https://iph.ras.ru/relationships#>
|
||||
SELECT DISTINCT ?excerptID ?excerptName
|
||||
WHERE {
|
||||
?excerptID pr:belongsTo ?individualURI .
|
||||
?excerptID rdfs:label ?excerptName .
|
||||
?excerptID rdf:type ts_:elenphExcerpt .
|
||||
} ORDER BY ?excerptName
|
||||
""" .
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
@prefix vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> .
|
||||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
||||
@prefix ts_: <https://iph.ras.ru/text_structures#> .
|
||||
|
||||
ts_:elenphArticle vitro:customDisplayViewAnnot "elenphAritcle.ftl"^^xsd:string .
|
|
@ -0,0 +1,5 @@
|
|||
@prefix vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> .
|
||||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
||||
@prefix ts_: <https://iph.ras.ru/text_structures#> .
|
||||
|
||||
ts_:elenphExcerpt vitro:customDisplayViewAnnot "elenphExcerpt.ftl"^^xsd:string .
|
|
@ -0,0 +1,5 @@
|
|||
@prefix vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> .
|
||||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
||||
@prefix pr: <https://iph.ras.ru/relationships#> .
|
||||
|
||||
pr:rubric vitro:customDisplayViewAnnot "rubric.ftl"^^xsd:string .
|
Loading…
Add table
Add a link
Reference in a new issue