1

I have my ontology and I am capable of running SPARQL queries like SELECT queries. But I can't find a way to add/create a new class for my ontology. I look for a solution online but all information I saw are modifications of the ontology. I mean transform or add an existing ObjectProperty between two resources, which exist also.

I'm using TopBraid Composer Free Edition

I have tried :

CONSTRUCT {
  rule:Kayaking a owl:Class .
  rule:Kayaking rdfs:subClassOf rule:Activity .
  rule:Kayaking rdfs:label "Kayaking" .
}
WHERE {
}

where myprefix => http://myapplication/

but it doesn't work and I can't figure out how to merge it in my ontology.. (I haven't enough reputation to post pictures sorry...)

scotthenninger
  • 3,921
  • 1
  • 15
  • 24
Perceeval
  • 11
  • 4

1 Answers1

0

I take it you executed this query in the SPARQL View pane in Composer? That will display the results as triples in the grid to the right of the SPARQL View. But CONSTRUCT will only return triples. You then need to tell the system what to do with those triples.

So choose the triples generated by the query (select all in the right-hand side grid). Scroll across the icons at the top of that pane. Choosing the fat blue arrow will "Assert" the selected triples into the currently open graph. Choosing the three blue circles will temporarily "Infer" the triples in the currently open graph.

As an alternative, use SPARQL Update:

INSERT {
  rule:Kayaking a owl:Class .
  rule:Kayaking rdfs:subClassOf rule:Activity .
  rule:Kayaking rdfs:label "Kayaking" .
}
WHERE {}

...which asserts the triples into the currently open graph. If you want to target the insertion to a specific graph, then use GRAPH:

INSERT {
  GRAPH <graph-url> {
     rule:Kayaking a owl:Class .
     rule:Kayaking rdfs:subClassOf rule:Activity .
     rule:Kayaking rdfs:label "Kayaking" .
  }
}
WHERE {}
scotthenninger
  • 3,921
  • 1
  • 15
  • 24