Skip to content

Commit

Permalink
Separate containsType/containsOperator.
Browse files Browse the repository at this point in the history
No need to investigate containsOperator statements pointlessly.
  • Loading branch information
nsbgn committed Jul 25, 2023
1 parent 35c5000 commit cc695c0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
6 changes: 3 additions & 3 deletions transforge/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def add_expr(self, expr: Expr, root: Node,
self.add((current, TF.type, type_node))

if self.with_membership:
self.add((root, TF.contains, type_node))
self.add((root, TF.containsType, type_node))

if self.with_labels:
self.add((current, RDFS.label,
Expand All @@ -250,15 +250,15 @@ def add_expr(self, expr: Expr, root: Node,
self.add((current, TF.via, op_node))

if self.with_membership:
self.add((root, TF.contains, op_node))
self.add((root, TF.containsOperator, op_node))

if self.with_types and canonical and essential:

type_node = self.add_type(output_type)
self.add((current, TF.type, type_node))

if self.with_membership:
self.add((root, TF.contains, type_node))
self.add((root, TF.containsType, type_node))

if self.with_labels:
self.add((current, RDFS.label, Literal(
Expand Down
4 changes: 2 additions & 2 deletions transforge/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def types(self) -> Iterator[str]:
if i:
yield "} UNION {"
v = self.fresh()
yield f"?workflow :contains {v.n3()}."
yield f"?workflow :containsType {v.n3()}."
yield (
f"GRAPH {self.lang.vocab.n3()} {{"
f"{v.n3()} rdfs:subClassOf {self.lang.uri(t).n3()} }}")
Expand All @@ -275,7 +275,7 @@ def operators(self) -> Iterator[str]:
operators.add(operator_choice[0])

for operator in operators:
yield f"?workflow :contains {operator.n3()}."
yield f"?workflow :containsOperation {operator.n3()}."

def io(self) -> Iterator[str]:
"""
Expand Down
13 changes: 11 additions & 2 deletions vocab/transforge.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,22 @@
a rdfs:Class; rdfs:subClassOf :Transformation;
rdfs:comment "A task is a transformation graph that represents a query; it describes pertinent aspects of a transformation, for the purpose of retrieving matching tools or workflows.".

:contains
a rdf:Property;
:contains a rdf:Property;
rdfs:subPropertyOf rdfs:member;
rdfs:comment "Identifies constituent elements of a transformation, in terms of its types and operations.";
rdfs:domain :Transformation;
rdfs:range :Atom.

:containsType a rdf:Property;
rdfs:subPropertyOf :contains;
rdfs:domain :Transformation;
rdfs:range :Type.

:containsOperation a rdf:Property;
rdfs:subPropertyOf :contains;
rdfs:domain :Transformation;
rdfs:range :Operation.

:input
a rdf:Property;
rdfs:comment "Identifies the source concept of a transformation, ie. the concept associated with input data.";
Expand Down

0 comments on commit cc695c0

Please sign in to comment.