Closed constnick closed 3 years ago
Hi, relation methods only add the specified relation to the ontology, not the involved class/property/fact definitions: these are in scope of AddClass/AddProperty/AddFact methods on which you have full control when modeling. This is the reason of the 0 counter for facts. The inconsistency you describe is that during the graph->ontology process the fact definitions can only be obtained along with rdf:type relations: when it gets "item rdf:type ontoClass" it also gets "item" fact, this is the reason of the 1 counter for facts.
If this inconsistency is some way hard or blocking you, I may consider automatic addition of fact in AddClassTypeRelation to harmonize the behavior. At least for facts this would be quite safe.
As far as I understand, there is a difference between class/property definition and definition of individual in any ontology.
The first must be explicite, e.g. ontoClass rdf:type owl:Class
, but the second is not: assertion item rdf:type owl:NamedIndividual
is not mandatory, so assertion item rdf:type ontoClass
is sufficient for defining item
.
It is clear in ontology point of view, what AddClass
or AddProperty
do, unlike AddFact
which looks like making only program sense (imho). For example if invoke AddFact
for empty just created ontology, no triples will be added to it's corresponding rdf graph.
So, maybe, automatic addition of individual in AddClassTypeRelation
would be logically right.
(Sorry, I'm a little confused by unusual naming of RDFSharp classes using "Fact" and "Taxonomy" terms, although it is clear that nothing can be done about it :)
Ok, I'll adjust AddClassTypeRelation to also add the individual to the ontology data.
Hi Marco, why the
ontology.Data.FactsCount
value doesn't increase when relation added with newRDFOntologyFact
? And this value is correct in exactly the same ontology parsed from graph.I know and use the
Data.AddFact
method, but question is not "how to do": I mean, there is some inconsistency when two identical ontologies can have different values of the same property describing their content.