Skip to content

Commit b66c568

Browse files
committed
Exclude PPLAN.Variable from semantic types returned by _get_variable()
1 parent 9591d6c commit b66c568

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fairworkflows/fairstep.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,9 @@ def _get_variable(self, var_ref: Union[rdflib.term.BNode, rdflib.URIRef]) -> Fai
227227
rdfs_comment_objs = list(self._rdf.objects(var_ref, RDFS.comment))
228228
computational_type = str(rdfs_comment_objs[0])
229229

230+
# Get all semantic types of this FairVariable, excluding PPLAN.Variable
230231
sem_type_objs = self._rdf.objects(var_ref, RDF.type)
231-
sem_types = [sem_type for sem_type in sem_type_objs]
232+
sem_types = [sem_type for sem_type in sem_type_objs if sem_type != namespaces.PPLAN.Variable]
232233

233234
if isinstance(var_ref, rdflib.term.BNode):
234235
return FairVariable(name=str(var_ref), computational_type=computational_type, semantic_types=sem_types)

0 commit comments

Comments
 (0)