I have an API that receive a JSON document with classes, properties and axioms of an ontology. The file looks like this:
{
"id": "https://onto4alleditor.com/pt/idDoProjeto",
"filetype": "OWL",
"classes": [{
"Name": "Homem",
"SubClassOf": ["Pessoa"],
"DisjointWith": ["Mulher"],
"Annotation": [{"Annotation":"Homo sapiens do sexo masculino.", "Language":"pt"},
{"Annotation": "Male homo sapiens.", "Language": "en"}]
},
{
"Name": "Mulher",
"Constraint": ["Mulher EquivalentTo: (NOT Homem)"],
"SubClassOf": ["Pessoa"]
}
]
}
The variable Constraint is an expression obtained from the Expression Editor of the Protegé. I'm trying to to add this expression to my OWLOntology object, but I'm receiving the following error:
Encountered Mulher at line 1 column 1. Expected one of:
Class name
Object property name
Data property name
inv
Functional
inverse
InverseFunctional
(
Asymmetric
Transitive
Irreflexive
{
Symmetric
Reflexive
Mulher is a class of my ontology, thus the error doesn't make sense. I'm not sure why this is happening, as I believe my code is initializing the parser properly (I'm using the Manchester Parser to do the job).Here follows my code:
private void loadClassConstraints(JSONArray constraints){
ManchesterOWLSyntaxParser parser = OWLManager.createManchesterParser();
parser.setDefaultOntology(this.ont);
for (int i = 0; i < constraints.length(); i++) {
parser.setStringToParse(constraints.getString(i));
this.ont.add(parser.parseAxiom());
}
}
What is going wrong? I couldn't find enough documentation on the internet which applies to my problem.Thanks in advance for any help.