How to Sparql INSERT in TopBraid Composer?

401 Views Asked by At

I'm trying to insert new classes by using Sparql in TopBraid Composer (ME 5.5.2). My simple ontology looks like this:

enter image description here

Then I wrote a Sparql query to insert Berry as a subclass of Fruit:

PREFIX ft: <http://www.semanticweb.org/ontologies/2018/7/fruit#>
PREFIX rdfs: <ttp://www.w3.org/2000/01/rdf-schema#>

INSERT
{ft:Berry    rdfs:subClassOf  ft:Fruit}

But an error message appeared, saying Encountered "insert". Was expecting one of: "base, "select", ...

A similar post: Sparql insert data not working says that Sparql Query is a different language from Sparql Update. Some other post says that Sparql Update is not supported in Protege but is supported in Composer (for which reason I downloaded Composer). I also checked the Composer manual: https://www.topquadrant.com/docs/TBC-Getting-Started-Guide52.pdf, which mentions Sparql Update but doesn't say much.

My question then is, is it possible to insert classes and axioms in TopBraid? If so, how? My end goal is that the inserted classes will appear in the hierarchical view, and their inserted class definitions can be seen on the side as well. If Composer can't do this, what other tools/workflows can I use?

Sorry for such a newbie question. Any help is appreciated.

1

There are 1 best solutions below

2
On BEST ANSWER

There are two forms of INSERT in SPARQL 1.1 Update:

You are mixing them up.

The following works for me in TBC 5.5.2 Free Edition against the kennedys.ttl example:

INSERT DATA
    { kennedys:UralStateUniversity a kennedys:College }

Being an unknown URI, the subject is underlined in query editor, but just press the "Execute SPARQL" button.

Update

In your particular case, you should say something like

INSERT DATA
    { ft:Berry rdfs:subClassOf ft:Fruit; a owl:Class }

Please note that owl:Class is used. TBC considers instances of rdfs:Class as "system classes", their icons are brown, not yellow.