Skip to content

Commit 8b3f1ef

Browse files
committed
In-process graph work
1 parent 07b3b5c commit 8b3f1ef

File tree

4 files changed

+153
-6
lines changed

4 files changed

+153
-6
lines changed

graph/ontologies/uxmethods-core.ttl

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
88
@prefix prov: <http://www.w3.org/ns/prov#> .
99
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
10-
@base <https://uxmethods.org/ontologies/uxmethods-core> .
10+
@base <https://uxmethods.org/ontologies/uxmethods-core#> .
1111

1212
<https://uxmethods.org/ontologies/uxmethods-core> rdf:type owl:Ontology ;
1313
owl:versionIRI <https://uxmethods.org/ontologies/uxmethods-core/0.1.0> ;
@@ -84,13 +84,33 @@ uxm:hasConcept rdf:type owl:ObjectProperty ;
8484
rdfs:label "has concept"@en .
8585

8686

87+
### https://uxmethods.org/ontologies/uxmethods-core#hasDownstreamMethod
88+
uxm:hasDownstreamMethod rdf:type owl:ObjectProperty ;
89+
rdfs:domain uxm:Method ;
90+
rdfs:range uxm:Method ;
91+
owl:propertyChainAxiom ( uxm:producesOutput
92+
[ owl:inverseOf uxm:usesInput
93+
]
94+
) .
95+
96+
8797
### https://uxmethods.org/ontologies/uxmethods-core#hasResearchQuestion
8898
uxm:hasResearchQuestion rdf:type owl:ObjectProperty ;
8999
rdfs:domain prov:Activity ;
90100
rdfs:range uxm:ResearchQuestion ;
91101
rdfs:label "has research question"@en .
92102

93103

104+
### https://uxmethods.org/ontologies/uxmethods-core#hasUpstreamMethod
105+
uxm:hasUpstreamMethod rdf:type owl:ObjectProperty ;
106+
rdfs:domain uxm:Method ;
107+
rdfs:range uxm:Method ;
108+
owl:propertyChainAxiom ( uxm:usesInput
109+
[ owl:inverseOf uxm:producesOutput
110+
]
111+
) .
112+
113+
94114
### https://uxmethods.org/ontologies/uxmethods-core#partOfStudy
95115
uxm:partOfStudy rdf:type owl:ObjectProperty ;
96116
rdfs:domain prov:Activity ;
@@ -108,6 +128,13 @@ uxm:producedArtifact rdf:type owl:ObjectProperty ;
108128
rdfs:label "produced artifact"@en .
109129

110130

131+
### https://uxmethods.org/ontologies/uxmethods-core#producesOutput
132+
uxm:producesOutput rdf:type owl:ObjectProperty ;
133+
rdfs:subPropertyOf owl:topObjectProperty ;
134+
rdfs:domain uxm:Method ;
135+
rdfs:range <http://www.w3.org/2004/02/skos/core#Concept> .
136+
137+
111138
### https://uxmethods.org/ontologies/uxmethods-core#supportingEvidence
112139
uxm:supportingEvidence rdf:type owl:ObjectProperty ;
113140
rdfs:domain prov:Entity ;
@@ -125,6 +152,13 @@ uxm:usedArtifact rdf:type owl:ObjectProperty ;
125152
rdfs:label "used artifact"@en .
126153

127154

155+
### https://uxmethods.org/ontologies/uxmethods-core#usesInput
156+
uxm:usesInput rdf:type owl:ObjectProperty ;
157+
rdfs:subPropertyOf owl:topObjectProperty ;
158+
rdfs:domain uxm:Method ;
159+
rdfs:range <http://www.w3.org/2004/02/skos/core#Concept> .
160+
161+
128162
### https://uxmethods.org/ontologies/uxmethods-core#usesMethod
129163
uxm:usesMethod rdf:type owl:ObjectProperty ;
130164
rdfs:subPropertyOf prov:hadPlan ;
@@ -158,6 +192,10 @@ uxm:status rdf:type owl:DatatypeProperty ;
158192
# Classes
159193
#################################################################
160194

195+
### http://www.w3.org/2004/02/skos/core#Concept
196+
<http://www.w3.org/2004/02/skos/core#Concept> rdf:type owl:Class .
197+
198+
161199
### https://uxmethods.org/ontologies/uxmethods-core#Agent
162200
uxm:Agent rdf:type owl:Class ;
163201
rdfs:subClassOf prov:Agent ;

graph/queries/get-neightbors.rq

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
PREFIX uxmo: <https://uxmethods.org/ontologies/uxmethods-core#>
2+
PREFIX uxmd: <https://uxmethods.org/method/>
3+
PREFIX uxmio: <https://uxmethods.org/taxonomies/io#>
4+
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
5+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
6+
7+
SELECT
8+
?origin
9+
?direction
10+
?neighborMethod
11+
?neighborLabel
12+
(COUNT(DISTINCT ?shared) AS ?weight)
13+
14+
WHERE {
15+
VALUES ?origin { uxmd:DomainModeling uxmd:Wireframing }
16+
17+
{
18+
# Upstream: neighbor produces what origin needs (origin inputs)
19+
BIND("upstream" AS ?direction)
20+
21+
?origin uxmo:usesInput ?shared .
22+
?neighborMethod a uxmo:Method ;
23+
uxmo:producesOutput ?shared ;
24+
rdfs:label ?neighborLabel .
25+
}
26+
UNION
27+
{
28+
# Downstream: neighbor needs what origin produces (origin outputs)
29+
BIND("downstream" AS ?direction)
30+
31+
?origin uxmo:producesOutput ?shared .
32+
?neighborMethod a uxmo:Method ;
33+
uxmo:usesInput ?shared ;
34+
rdfs:label ?neighborLabel .
35+
}
36+
FILTER(?neighborMethod != ?origin)
37+
}
38+
GROUP BY ?direction ?origin ?neighborMethod ?neighborLabel
39+
ORDER BY ?origin ?direction DESC(?weight) LCASE(STR(?neighborLabel))
40+
41+
# ?inputMethod uxmo:producesOutput ?input;
42+
# rdfs:label ?inputLabel.
43+
# OPTIONAL {
44+
# ?input ?p ?inputMethodLabel.
45+
46+
# }
47+
48+
49+
50+
# ?origin uxmo:producesOutput ?output.
51+
52+
53+
# ?destination uxmo:usesInput ?output.
54+
# ?output skos:prefLabel ?outputLabel.
55+
# FILTER(?origin != ?destination)
56+
57+
# GROUP BY ?origin ?destination
58+
# ORDER BY DESC(?sharedIoCount)
59+
60+
#

graph/queries/get-shared-output.rq

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
PREFIX uxmo: <https://uxmethods.org/ontologies/uxmethods-core#>
2+
PREFIX uxmd: <https://uxmethods.org/method/>
3+
PREFIX uxmio: <https://uxmethods.org/taxonomies/io#>
4+
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
5+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
6+
7+
SELECT ?origin ?inputMethod (COUNT(DISTINCT ?shared) AS ?weight)
8+
9+
WHERE {
10+
?origin a uxmo:Method ;
11+
rdfs:label "Wireframing"@en;
12+
uxmo:usesInput ?shared.
13+
14+
?inputMethod a uxmo:Method;
15+
uxmo:producesOutput ?shared.
16+
}
17+
GROUP BY ?origin ?inputMethod
18+
ORDER BY DESC(?weight)
19+
20+
# ?inputMethod uxmo:producesOutput ?input;
21+
# rdfs:label ?inputLabel.
22+
# OPTIONAL {
23+
# ?input ?p ?inputMethodLabel.
24+
25+
# }
26+
27+
28+
29+
# ?origin uxmo:producesOutput ?output.
30+
31+
32+
# ?destination uxmo:usesInput ?output.
33+
# ?output skos:prefLabel ?outputLabel.
34+
# FILTER(?origin != ?destination)
35+
36+
# GROUP BY ?origin ?destination
37+
# ORDER BY DESC(?sharedIoCount)
38+
39+
#
Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1-
PREFIX uxm: <https://uxmethods.org/ontologies/uxmethods-core#>
1+
PREFIX uxmo: <https://uxmethods.org/ontologies/uxmethods-core#>
2+
# change this to just /ontologies/core#
3+
PREFIX uxmd: <https://uxmethods.org/method/>
4+
# change this to /data/ ?
5+
PREFIX uxmio: <https://uxmethods.org/taxonomies/io#>
6+
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
27

38
# Finds method-to-method enablement links:
49
# m1 produces an output that m2 uses as an input.
510

6-
SELECT ?m1 ?m2 ?shared
11+
SELECT ?m1Label ?m2Label ?sharedLabel
712
WHERE {
8-
?m1 a uxm:Method ; uxm:producesOutput ?shared .
9-
?m2 a uxm:Method ; uxm:usesInput ?shared .
13+
?m1 a uxmo:Method ;
14+
uxmo:producesOutput ?shared ;
15+
rdfs:label ?m1Label .
16+
?m2 a uxmo:Method ;
17+
uxmo:usesInput ?shared ;
18+
rdfs:label ?m2Label .
19+
?shared skos:prefLabel ?sharedLabel .
1020
FILTER(?m1 != ?m2)
1121
}
12-
ORDER BY ?shared ?m1 ?m2
22+
ORDER BY ?m1Label ?m2Label ?sharedLabel

0 commit comments

Comments
 (0)