-
Notifications
You must be signed in to change notification settings - Fork 0
/
predicate2framester.sparql
64 lines (63 loc) · 2.42 KB
/
predicate2framester.sparql
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
PREFIX frame: <http://www.ontologydesignpatterns.org/ont/framenet/abox/frame/>
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
PREFIX xyz: <http://sparql.xyz/facade-x/data/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix pbschema: <https://w3id.org/framester/pb/pbschema/>
PREFIX fschema: <https://w3id.org/framester/schema/>
CONSTRUCT {
?fPredicate a pbschema:Predicate ;
rdfs:label ?lemma ;
pbschema:hasRoleSet ?fRoleset .
?fRoleset a pbschema:RoleSet ;
pbschema:hasAlias ?fFrame ;
rdfs:label ?name ;
pbschema:hasRole ?fRole .
?fRole a pbschema:Role ;
rdfs:label ?roleDescription ;
fschema:subsumedUnder ?argClass .
}
WHERE {
SERVICE <x-sparql-anything:> {
fx:properties fx:location "https://github.com/propbank/propbank-frames/archive/refs/tags/v3.1.zip" .
fx:properties fx:archive.matches "propbank-frames-3.1/frames/[^_]*.xml" .
?s1 ?p1 ?file1 .
SERVICE <x-sparql-anything:> {
fx:properties fx:location ?file1 .
fx:properties fx:from-archive "https://github.com/propbank/propbank-frames/archive/refs/tags/v3.1.zip" .
?s a xyz:frameset .
?s ?li ?predicate .
?predicate a xyz:predicate .
?predicate xyz:lemma ?lemma .
?predicate ?li2 ?roleset .
?roleset a xyz:roleset .
?roleset xyz:name ?name .
?roleset ?li3 ?aliases .
?roleset xyz:id ?id .
?roleset ?li5 ?roles .
?roles a xyz:roles .
?roles ?li6 ?role .
?role a xyz:role .
?role xyz:n ?num .
?role xyz:descr ?roleDescription .
?aliases a xyz:aliases .
?aliases ?li4 ?alias .
?alias a xyz:alias .
?alias xyz:framenet ?f .
BIND(IRI(CONCAT("https://w3id.org/framester/pb/data/predicate/",str(?lemma))) AS ?fPredicate)
BIND(IRI(CONCAT("https://w3id.org/framester/pb/data/roleset/",str(?id))) AS ?fRoleset)
BIND(IRI(CONCAT("https://w3id.org/framester/pb/data/roleset/",str(?id),"__",str(?num))) AS ?fRole)
BIND(IRI(CONCAT("https://w3id.org/framester/pb/pbschema/ARG",str(?num))) AS ?argClass)
OPTIONAL{
SERVICE <x-sparql-anything:> {
fx:properties fx:content ?f .
fx:properties fx:txt.split " " .
Filter(isLiteral(?frameId))
FILTER(strlen(str(?f))>0)
?a ?b ?frameId
BIND(IRI(CONCAT("https://w3id.org/framester/framenet/abox/frame/", ?frameId)) AS ?fFrame)
}
}
}
}
}