Get level of excerpts in document

This commit is contained in:
Georgy Litvinov 2021-03-03 17:25:29 +01:00
parent c8496ffe2f
commit 5f6cff9824
2 changed files with 16 additions and 17 deletions

View file

@ -45,7 +45,7 @@ display:getCompilationExcerptPathsDataGetter
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ts_: <https://litvinovg.pro/text_structures#> PREFIX ts_: <https://litvinovg.pro/text_structures#>
SELECT (GROUP_CONCAT(substr(concat("000",str(?outline)),strlen(str(?outline))); SEPARATOR = ".") AS ?path ) ?tocElement ?elenphExcerpt SELECT (GROUP_CONCAT(substr(concat("000",str(?outline)),strlen(str(?outline))); SEPARATOR = ".") AS ?path ) (COUNT(?outline) AS ?level) ?tocElement ?elenphExcerpt
WHERE { WHERE {
?individualURI ts_:hasTOC ?toc . ?individualURI ts_:hasTOC ?toc .
?toc ts_:hasTOCItem/(ts_:pointsTo/ts_:hasTOCItem)* ?tmpTOCItem . ?toc ts_:hasTOCItem/(ts_:pointsTo/ts_:hasTOCItem)* ?tmpTOCItem .

View file

@ -45,7 +45,7 @@ display:getArticleExcerptPathsDataGetter
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ts_: <https://litvinovg.pro/text_structures#> PREFIX ts_: <https://litvinovg.pro/text_structures#>
SELECT (GROUP_CONCAT(substr(concat("000",str(?outline)),strlen(str(?outline))); SEPARATOR = ".") AS ?path ) ?tocElement ?elenphExcerpt SELECT (GROUP_CONCAT(substr(concat("000",str(?outline)),strlen(str(?outline))); SEPARATOR = ".") AS ?path ) (COUNT(?outline) AS ?level) ?tocElement ?elenphExcerpt
WHERE { WHERE {
?individualURI ts_:hasTOC ?toc . ?individualURI ts_:hasTOC ?toc .
?toc ts_:hasTOCItem/(ts_:pointsTo/ts_:hasTOCItem)* ?tmpTOCItem . ?toc ts_:hasTOCItem/(ts_:pointsTo/ts_:hasTOCItem)* ?tmpTOCItem .
@ -61,7 +61,6 @@ display:getArticleExcerptPathsDataGetter
?individualURI ts_:hasTOC ?toc . ?individualURI ts_:hasTOC ?toc .
?toc (ts_:hasTOCItem/ts_:pointsTo)+ ?tocElement . ?toc (ts_:hasTOCItem/ts_:pointsTo)+ ?tocElement .
?tocElement rdf:type ts_:TOCLevel . ?tocElement rdf:type ts_:TOCLevel .
?individualURI rdf:type ts_:elenphArticle .
} }
} }
} GROUP BY ?tocElement ?elenphExcerpt ORDER BY ?path } GROUP BY ?tocElement ?elenphExcerpt ORDER BY ?path