@@ -36,10 +36,13 @@ ${triplesFor(dosdp).mkString("\n")}
3636 }
3737
3838 def selectFor (dosdp : DOSDP ): String = {
39- val variables = dosdp.axiomTemplates.flatMap(selectVariables)
39+ val axVariables = axiomVariables(dosdp)
40+ val variables = axVariables ++ axVariables.map(_ + " __label" )
4041 if (variables.isEmpty) " *" else variables.toSeq.sorted.mkString(" " )
4142 }
4243
44+ private def axiomVariables (dosdp : DOSDP ): Set [String ] = dosdp.axiomTemplates.flatMap(selectVariables)
45+
4346 private val DOSDPVariable = s " ^ ${DOSDP .variablePrefix}(.+) " .r
4447
4548 def selectVariables (axiom : OWLAxiom ): Set [String ] =
@@ -56,7 +59,8 @@ ${triplesFor(dosdp).mkString("\n")}
5659 case (variable, named : OWLClass ) => Seq (s " ? ${DOSDP .processedVariable(variable)} rdfs:subClassOf* < ${named.getIRI}> . " )
5760 case (variable, expression) => Seq (s " ? ${DOSDP .processedVariable(variable)} rdfs:subClassOf ${expression.asOMN} . " )
5861 }
59- axiomTriples ++ variableTriples
62+ val labelTriples = axiomVariables(dosdp).map(v => s " OPTIONAL { ? $v rdfs:label ${v}__label . } " )
63+ axiomTriples ++ variableTriples ++ labelTriples
6064 }
6165
6266 def triples (axiom : OWLAxiom ): Seq [String ] = axiom match {
@@ -117,7 +121,7 @@ ${triplesFor(dosdp).mkString("\n")}
117121 val listLengthTriple = s " $node owl:intersectionOf/ ${and.getOperands.toSeq.map(_ => " rdf:rest" ).mkString(" /" )} rdf:nil . "
118122 (node, (intersectionTriples.toSeq :+ listLengthTriple) ++ operandTriplesList.toSeq.flatten ++ filters)
119123 }
120- case or : OWLObjectUnionOf => ???
124+ case or : OWLObjectUnionOf => ???
121125 case only : OWLObjectAllValuesFrom => ???
122126 }
123127
0 commit comments