Merge branch 'texts' of dev.litvinovg.pro:litvinovg/vivo into texts

This commit is contained in:
Svetlana Rastegina 2021-02-28 21:39:00 +01:00
commit a54c66fecf

View file

@ -1,46 +1,73 @@
@prefix : <http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#> .
@prefix searchIndex: <java:edu.cornell.mannlib.vitro.webapp.searchindex#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
:vivodocumentModifier_excerptsInArticles
:vivodocumentModifier_excerptsInComplexPublications
a <java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.SelectQueryDocumentModifier> ,
<java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.DocumentModifier> ;
rdfs:label "Elenph article excerpts" ;
rdfs:label "Populate complex publications with excerpts" ;
:hasTargetField "ALLTEXT" ;
:hasSelectQuery """
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ts_: <https://litvinovg.pro/text_structures#>
PREFIX ts: <https://litvinovg.pro/text_structures#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT DISTINCT ?value
WHERE {
?uri rdf:type ts_:elenphArticle .
?uri ts_:hasTOC ?toc .
?toc (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?elenphExcerpt .
VALUES ?property { ts_:works ts_:bibliography ts_:htmlExcerpt ts_:keywords }
?elenphExcerpt ?property ?value .
?uri ts:hasTOC ?toc .
?toc (ts:hasTOCItem/ts:pointsTo)+/ts:hasText ?excerpt .
VALUES ?property { ts:works ts:bibliography ts:htmlExcerpt ts:keywords }
?excerpt ?property ?value .
}
""" .
:vivodocumentModifier_PopulateText
:vivoUriFinder_excerptsInComplexPublications
a searchIndex:indexing.IndexingUriFinder ,
searchIndex:indexing.SelectQueryUriFinder ;
rdfs:label "When excerpts change" ;
:hasSelectQuery """
PREFIX ts: <https://litvinovg.pro/text_structures#>
SELECT ?uri
WHERE {
?uri ts:hasTOC ?toc .
?toc (ts:hasTOCItem/ts:pointsTo)+/ts:hasText ?subject .
}
""" .
:vivoUriFinder_onRubricsAssign
a searchIndex:indexing.IndexingUriFinder ,
searchIndex:indexing.SelectQueryUriFinder ;
rdfs:label "When rubric was assigned" ;
:hasSelectQuery """
PREFIX ts: <https://litvinovg.pro/text_structures#>
SELECT ?uri
WHERE {
?subject a ts:textExcerpt .
VALUES ?uri { ?subject }
}
""" .
:vivodocumentModifier_PopulateTextWithHTMLContentsOfExcerpts
a <java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.SelectQueryDocumentModifier> ,
<java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.DocumentModifier> ;
rdfs:label "Html text to text field" ;
:hasTargetField "text" ;
:hasSelectQuery """
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ts_: <https://litvinovg.pro/text_structures#>
PREFIX ts: <https://litvinovg.pro/text_structures#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT DISTINCT ?htmlExcerpt
WHERE {
{
?uri rdf:type ts_:textExcerpt .
?uri ts_:htmlExcerpt ?htmlExcerpt .
?uri rdf:type ts:textExcerpt .
?uri ts:htmlExcerpt ?htmlExcerpt .
}
UNION
{
?uri rdf:type ts_:publication .
?uri ts_:hasTOC ?toc .
?toc (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?artExcerpt .
?artExcerpt ts_:htmlExcerpt ?htmlExcerpt .
?uri rdf:type ts:complexPublication .
?uri ts:hasTOC ?toc .
?toc (ts:hasTOCItem/ts:pointsTo)+/ts:hasText ?excerpt .
?excerpt ts:htmlExcerpt ?htmlExcerpt .
}
}
""" .
@ -52,22 +79,22 @@
:hasTargetField "rubrics" ;
:hasSelectQuery """
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ts_: <https://litvinovg.pro/text_structures#>
PREFIX ts: <https://litvinovg.pro/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 rdf:type ts:textExcerpt .
?uri pr:belongsTo ?assignedRubric .
?assignedRubric (pr:hasParent)* ?rubric .
}
UNION
{
?uri rdf:type ts_:elenphArticle .
?uri ts_:hasTOC ?toc .
?toc (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?artExcerpt .
?artExcerpt pr:belongsTo ?assignedRubric .
?uri rdf:type ts:complexPublication .
?uri ts:hasTOC ?toc .
?toc (ts:hasTOCItem/ts:pointsTo)+/ts:hasText ?excerpt .
?excerpt pr:belongsTo ?assignedRubric .
?assignedRubric (pr:hasParent)* ?rubric .
}
}
@ -95,20 +122,20 @@
:hasTargetField "keywords" ;
:hasSelectQuery """
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ts_: <https://litvinovg.pro/text_structures#>
PREFIX ts: <https://litvinovg.pro/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_:hasTOC ?toc .
?toc (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?elenphExcerpt .
?elenphExcerpt ts_:keywords ?keywords .
?uri rdf:type ts:elenphArticle .
?uri ts:hasTOC ?toc .
?toc (ts:hasTOCItem/ts:pointsTo)+/ts:hasText ?elenphExcerpt .
?elenphExcerpt ts:keywords ?keywords .
}
UNION
{
?uri rdf:type ts_:elenphExcerpt .
?uri ts_:keywords ?keywords .
?uri rdf:type ts:elenphExcerpt .
?uri ts:keywords ?keywords .
}
}
""" .
@ -120,20 +147,20 @@
:hasTargetField "bibliography" ;
:hasSelectQuery """
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ts_: <https://litvinovg.pro/text_structures#>
PREFIX ts: <https://litvinovg.pro/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_:hasTOC ?toc .
?toc (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?elenphExcerpt .
?elenphExcerpt ts_:bibliography ?bibliography .
?uri rdf:type ts:elenphArticle .
?uri ts:hasTOC ?toc .
?toc (ts:hasTOCItem/ts:pointsTo)+/ts:hasText ?elenphExcerpt .
?elenphExcerpt ts:bibliography ?bibliography .
}
UNION
{
?uri rdf:type ts_:elenphExcerpt .
?uri ts_:bibliography ?bibliography .
?uri rdf:type ts:elenphExcerpt .
?uri ts:bibliography ?bibliography .
}
}
""" .