Added custom fields

This commit is contained in:
Georgy Litvinov 2020-08-10 11:18:37 +02:00
parent bbf3242a03
commit 4f553c963e

View file

@ -1,7 +1,7 @@
@prefix : <http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#> . @prefix : <http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
:vivodocumentModifier_openAccess :vivodocumentModifier_excerptsInArticles
a <java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.SelectQueryDocumentModifier> , a <java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.SelectQueryDocumentModifier> ,
<java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.DocumentModifier> ; <java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.DocumentModifier> ;
rdfs:label "Elenph article excerpts" ; rdfs:label "Elenph article excerpts" ;
@ -17,3 +17,85 @@
?elenphExcerpt ?property ?value . ?elenphExcerpt ?property ?value .
} }
""" . """ .
:vivodocumentModifier_rubricsOfExcerpt
a <java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.SelectQueryDocumentModifier> ,
<java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.DocumentModifier> ;
rdfs:label "Add rubrics in semantic_marks excerpt field" ;
:hasTargetField "semantic_marks" ;
: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#>
PREFIX pr: <https://iph.ras.ru/relationships#>
SELECT DISTINCT ?rubric
WHERE {
?uri rdf:type ts_:elenphExcerpt .
?uri pr:belongsTo ?assignedRubric .
?assignedRubric (pr:hasParent)* ?rubric .
}
""" .
:vivodocumentModifier_titles
a <java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.SelectQueryDocumentModifier> ,
<java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.DocumentModifier> ;
rdfs:label "Add titles to special field" ;
:hasTargetField "titles" ;
:hasSelectQuery """
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT DISTINCT ?title
WHERE {
?uri rdfs:label ?title .
}
""" .
:vivodocumentModifier_keywordsElenph
a <java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.SelectQueryDocumentModifier> ,
<java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.DocumentModifier> ;
rdfs:label "Keywords for articles and excerpts" ;
:hasTargetField "keywords" ;
: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 ?keywords
WHERE {
{
?uri rdf:type ts_:elenphArticle .
?uri (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?elenphExcerpt .
?elenphExcerpt ts_:keywords ?keywords .
}
UNION
{
?uri rdf:type ts_:elenphExcerpt .
?uri ts_:keywords ?keywords .
}
}
""" .
:vivodocumentModifier_bibliographyElenph
a <java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.SelectQueryDocumentModifier> ,
<java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.DocumentModifier> ;
rdfs:label "Bibliography for articles and excerpts" ;
:hasTargetField "bibliography" ;
: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 ?bibliography
WHERE {
{
?uri rdf:type ts_:elenphArticle .
?uri (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?elenphExcerpt .
?elenphExcerpt ts_:bibliography ?bibliography .
}
UNION
{
?uri rdf:type ts_:elenphExcerpt .
?elenphExcerpt ts_:bibliography ?bibliography .
}
}
""" .