-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsentiment-text.rq
27 lines (23 loc) · 1.03 KB
/
sentiment-text.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
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 (SUM(?v) as ?sentVal) (COUNT(?v) as ?count)
((SUM(?v) / COUNT(?v)) as ?normVal)
WHERE {
VALUES ?polarity { marl:Positive marl:Negative }
?le ontolex:canonicalForm ?lemma ;
ontolex:sense ?sense .
?sense marl:hasPolarity ?polarity ;
marl:polarityValue ?v .
?token lila:hasLemma ?lemma ;
^powla:hasChild/^lila_corpora:hasCitSubUnit ?ep.
?CitationLayer powla:hasDocument
<http://lila-erc.eu/data/corpora/UDante/id/corpus/Epistole>;
lila_corpora:isLayer ?ep .
} group by (?ep)
order by ?ep