-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsentiment-paragraph.rq
28 lines (24 loc) · 1.04 KB
/
sentiment-paragraph.rq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix ontolex: <http://www.w3.org/ns/lemon/ontolex#>
prefix lila: <http://lila-erc.eu/ontologies/lila/>
prefix lime: <http://www.w3.org/ns/lemon/lime#>
prefix marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#>
prefix powla: <http://purl.org/powla/powla.owl#>
prefix lila_corpora: <http://lila-erc.eu/ontologies/lila_corpora/>
SELECT ?ep ?par (SUM(?v) as ?sentVal) (COUNT(?v) as ?count)
((SUM(?v) / COUNT(?v)) as ?normVal)
WHERE {
?CitationLayer powla:hasDocument
<http://lila-erc.eu/data/corpora/UDante/id/corpus/Epistole>;
lila_corpora:isLayer ?ep .
?ep lila_corpora:hasCitSubUnit ?par .
?par powla:hasChild ?token.
?token lila:hasLemma ?lemma .
VALUES ?polarity { marl:Positive marl:Negative }
?le ontolex:canonicalForm ?lemma ;
ontolex:sense ?sense .
?sense marl:hasPolarity ?polarity ;
marl:polarityValue ?v .
} group by ?ep ?par
order by ?ep ?par