Skip to content
Snippets Groups Projects
Commit bc24816d authored by usikora's avatar usikora :monkey:
Browse files

ignore Markers for rdg[@type='v' and @context='rdg'] and added test-query

parent 03f3b2ac
No related branches found
No related tags found
No related merge requests found
......@@ -303,7 +303,7 @@ declare function ident:identify-targets
: @param $reading-sequence sequence holding the evaluation reports of the relevant readings in the nodes' context
: @return converted node
:
: @version 2.0 (2018-02-01)
: @version 2.1 (2018-02-20)
: @status working
: @author Uwe Sikora
:)
......@@ -321,8 +321,10 @@ declare function ident:walk
)
)
case element(teiHeader) return ( $node )
(: considering all tei:rdg except structural-variances and textcritical tei:rdg[@type="v"]:)
case element(rdg) return (
if ( not($node/parent::app[ @type eq "structural-variance" ]) ) then (
if ( not($node/parent::app[ @type eq "structural-variance" ] or $node[@type="v"]) ) then (
let $identified-targets := ident:identify-targets($node)
return ident:mark-node( $node, ($reading-sequence, ident:identify-targets($node)) )
) else (
......@@ -330,6 +332,7 @@ declare function ident:walk
)
)
(: considering all tei:lem except structural-variances :)
case element(lem) return (
if ( not($node/parent::app[ @type eq "structural-variance" ]) ) then (
let $identified-targets := ident:identify-targets($node)
......
......@@ -41,10 +41,21 @@ declare function markerset:collect-markers
)
)
else if ($reading[self::rdg]) then (
element {name($reading)} {
$reading/@*,
attribute {"context"}{"rdg"}
}
if ($reading[@type = "ppl" or @type = "pp"][descendant::lem[@wit]]) then (
let $children-readings := $reading/descendant::rdg
return(
element {name($reading)} {
$reading/@*,
attribute {"context"}{"changed-lem ", data($children-readings/@wit)}
}
)
)
else (
element {name($reading)} {
$reading/@*,
attribute {"context"}{"rdg"}
}
)
)
else ()
)
......@@ -105,16 +116,14 @@ declare function markerset:merge-markers
:)
declare function markerset:marker
($name as xs:string, $type as xs:string, $reading as node()) as element(){
if($type = 'open' and data($reading/@type) = 'v' and $reading/@context = 'rdg')
then ()
else (element {$name} {
element {$name} {
(:attribute bdnp_parent {$node/parent::node()/name()}, :)
attribute wit { replace(data($reading/@wit), '#', '') },
attribute type { data($reading/@type) },
attribute ref { data($reading/@id) },
attribute mark { $type },
attribute context { $reading/@context }
})
}
};
......
xquery version "3.1";
declare namespace tei = "http://www.tei-c.org/ns/1.0";
import module namespace functx="http://www.functx.com";
import module namespace pre="http://bdn.edition.de/intermediate_format/preprocessing" at "xmldb:exist:///db/apps/interformat/modules/intermediate_format/preprocessing.xqm";
import module namespace ident = "http://bdn.edition.de/intermediate_format/identification" at "xmldb:exist:///db/apps/interformat/modules/intermediate_format/identification.xqm";
declare option exist:serialize "method=xml media-type=text/xml omit-xml-declaration=no indent=no";
(: http://localhost:8080/exist/rest/apps/interformat/rest/intermediate_format.xql :)
(:declare variable $doc-path := request:get-parameter("path", ()); :)
declare variable $doc-path := "/apps/interformat/data/samples/samples4.xml";
let $doc := doc($doc-path)
let $preprocessed-data := pre:preprocessing($doc/tei:TEI)
return (
ident:walk($preprocessed-data, ())
)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment