Host: bolt://neo4j.adwmainz.net
Login: digme
Passwort: |Rpmx18YvM6Zn-
MATCH (n) DETACH DELETE n;
create constraint on (t:Token) assert t.id is unique;
create constraint on (s:Sentence) assert s.id is unique;
create constraint on (l:Lemma) assert l.text is unique;
call
apoc.load.xmlSimple('http://deutschestextarchiv.de/book/download_fulltcf/16181')
yield value as doc
unwind doc._TextCorpus._tokens._token as token
create (t:Token{id:token.ID, text:token._text})
with collect(t) as tokens
unwind apoc.coll.pairs(tokens)[0..-1] as value
with value[0] as a, value[1] as b
create (a)-[:NEXT_TOKEN]->(b);
call
apoc.load.xmlSimple('http://deutschestextarchiv.de/book/download_fulltcf/16181')
yield value as doc
unwind doc._TextCorpus._sentences._sentence as sentence
match (t1:Token{id:head(split(sentence.tokenIDs, ' '))})
match (t2:Token{id:last(split(sentence.tokenIDs, ' '))})
create (s:Sentence{id:sentence.ID})
create (s)-[:SENTENCE_STARTS]->(t1)
create (s)-[:SENTENCE_ENDS]->(t2)
with collect(s) as sentences
unwind apoc.coll.pairs(sentences)[0..-1] as value
with value[0] as a, value[1] as b
create (a)-[:NEXT_SENTENCE]->(b);
call
apoc.load.xmlSimple('http://deutschestextarchiv.de/book/download_fulltcf/16181')
yield value as doc
unwind doc._TextCorpus._lemmas._lemma as lemma
match (t:Token{id:lemma.tokenIDs})
merge (l:Lemma{text:lemma._text})
create (t)-[:LEMMATISIERT]->(l);
call
apoc.load.xmlSimple('http://deutschestextarchiv.de/book/download_fulltcf/16181')
yield value as doc
unwind doc._TextCorpus._lemmas._lemma as lemma
match (t:Token{id:lemma.tokenIDs}) set t.Lemma = lemma._text;
match
w=()-[:NEXT_TOKEN*5]->(a:Token{Lemma:'Gestalt'})-[:NEXT_TOKEN*5]->()
return *;
call apoc.import.xml('https://seafile.rlp.net/f/6282a26504cc4f079ab9/?dl=1',
{connectCharacters: true, charactersForTag:{lb:' '}, filterLeadingWhitespace: true}) yield node
return node;
MATCH
(n0:XmlCharacters)-[r0:NE]->
(n1:XmlCharacters{text:'rotiren'})-[r1:NE]->
(n2:XmlCharacters{text:'bewegen'})-[r2:NE]->
(n3:XmlCharacters)-[r3:NE]->
(n4:XmlCharacters{text:'ſich'})-[r4:NE]->
(n5:XmlCharacters)
RETURN *;
MATCH
(n0:XmlCharacters)-[r0:NE]->
(n1:XmlCharacters{text:'rotiren'})-[r1:NE]->
(n2:XmlCharacters{text:'bewegen'})-[r2:NE]->
(n3:XmlCharacters)-[r3:NE]->
(n4:XmlCharacters{text:'ſich'})-[r4:NE]->
(n5:XmlCharacters)
DELETE r0, r1
CREATE (n0)-[:NE]->(n2)
CREATE (n0)-[:VARIANT{variant_type:'del'}]->(n1)
CREATE (n1)-[:VARIANT{variant_type:'del'}]->(n5);
MATCH
(n0:XmlCharacters)-[r0:NE]->
(n2:XmlCharacters{text:'bewegen'})-[r2:NE]->
(n3:XmlCharacters)-[r3:NE]->
(n4:XmlCharacters{text:'ſich'})-[r4:NE]->
(n5:XmlCharacters),
(n1:XmlCharacters{text:'rotiren'})-[r1:VARIANT]->(n5)
RETURN *;