I have created an ontology in Protege 5.2 and now I am trying to create correctly the object properties of my corresponding classes. Here is a snippet of my UML diagram according to which I have built my ontology:
Snippet of my ontology
Regarding the isLocated object property, they are characterized in the following way: If a Node X has a SITE value Z, and the same value Z appears in SITEIST of a Location Y, then Node X is Located in Location Y.
Should I look into SWRL rules or is there some way to encode this without having to go there?
Thank you guys in advance!
In SWRL you can achieve that straightforward:
locationHasSiteIst(?l, ?s) ^ nodeHasSite(?n, ?s) -> nodeLocatedInLocation(?n, ?l)
If you want yo make it in OWL, you need to make locationHasSiteIst and nodeHasSite as object properties, and Site as a class instead of a datatype, then you can use object property chaining and inclusion in Protege as follows:
nodeHasSite o inverse(locationHasSiteIst) SubPropertyOf nodeLocatedInLocation
The last line means that if a node n1 is located in site1, and a location l1 is located in s1 as well, then n1 is located in l1.
Related
May question is a bit basic. But I do not know what happens when we define "data range expressions" in protege? Does it limit the range only to the literals written there?
In what cases can we use "data range expressions?"
Below is an example that I saw in an ontology:
The semantics of data property domains and ranges are given by
which you can find defined in the direct semantics of OWL 2.
This means that for every 2 individuals x and y that are related by a data property DPE, that x is of type CE and y is of type DR.
In your example it means that if x and y are related via test type then the reasoner will infer x is of type Concrete placement OR Test and y is of type {"Self-inspection", "Third-Party Monitoring"}.
Update based on comment
This means that if individual y does not have the value of either "Self-inspection" OR "Third-Party Monitoring", it will result in the ontology being inconsistent.
So, yes, the user has to choose between these 2 values.
I have used an object property O to relate Class A with Class B. I also have instance a and b of classes A and B respectively. I have used the same object property O to relate the instances a and b.
Again, I have used the same object property O to link a with c, where c is an instance of Class C which is not linked with class A or B using any object property.
Reasoners are still showing that the Ontology is Consistent.
My question is "Should this not be marked as inconsistent by the reasoners? Please enlighten me regarding your answer, whether the answer is 'Yes' or 'No' and the reason behind your answer"?
Thanks in advance.
You understand the semantics of domain and range axioms incorrectly. In the case of your object property O it merely states that whenever 2 individuals x, y are linked via O it means that the reasoner will infer that x is of type A and y is of type B.
In the case linking individuals a and c where c is of type C you will notice that c is also now inferred to be of type B.
If you want to see an inconsistency, what you can do is make classes B and C disjoint. Then linking a and c via O will result in an inconsistency.
BTW, if you are interested, on my blog I write about OWL2 ontologies and the use of reasoners and some of the counter intuitive ways in which reasoners can seem to "fail".
I know what is a Parse Tree and what is an Abstract Tree but I after reading some about Annotated Parse Tree(as we draw detailed tree which is same as Parse Tree), I feel that they are same as Parse Tree.
Can anyone please explain differences among these three in detail ?
Thanks.
AN ANNOTATED PARSE TREE is a parse tree showing the values of the attributes at each node. The process of computing the attribute values at the nodes is called annotating or decorating the parse tree.
For example: Refer link below, it is annotated parse tree for 3*5+4n
https://i.stack.imgur.com/WAwdZ.png
A parse tree is a representation of how a source text (of a program) has been decomposed to demonstate it matches a grammar for a language. Interior nodes in the tree are language grammar nonterminals (BNF rule left hand side tokens), while leaves of the tree are grammar terminals (all the other tokens) in the order required by grammar rules.
An annotated parse tree is one in which various facts about the program have been attached to parse tree nodes. For example, one might compute the set of identifiers that each subtree mentions, and attach that set to the subtree. Compilers have to store information they have collected about the program somewhere; this is a convenient place to store information which is derivable form the tree.
An activation tree is conceptual snapshot of the result of a set of procedures calling one another at runtime. Node in such a tree represent procedures which have run; childen represent procedures called by their parent.
So a key difference between (annotated) parse trees and activation trees is what they are used to represent: compile time properties vs. runtime properties.
An annotated parse tree lets you intergrate the entire compilation into the parse tree structure. CM Modula-3 does that if im not mistaken.
To build an APT, simply declare an abstract base class of nodes, subclass each production on it and declare the child nodes as field variables.
Is there any difference between the following ways of expressing multiple necessary conditions in ontology (via Protege)
Each necessary condition expressed one by one inside the SubclassOf Section (for class A):
instrument some B
object some C
All of those stated at once (via the class expression editor)
instrument some B and object some C
Are 1 and 2 semantically the same?
Yes they are equivalent. The choice of which way to go is yours: which approach do you find more readable? That is the best choice.
When I create a RDFS_MEM_RDFS_INF model in Jena and read some RDFS-File, a number of statements, that were not explicitly stated in the file are added. E.g. if we have a triple
a p b
and p is a rdfs:subPropertyOf q, than
a q b is
also in the model. A concrete example is the following: if
a skos:related b
is in the file
a skos:semanticRelation b
is also in the model.
Is there any possibility to check whether a statement in the model is an axiom or an inferred one? There are such methods for OWL Models, but I use the RDFS Model. A trivial solution would be to build two models, one without and one with inference, but I would prefer a less memory consuming solution.
Jena InfModel has a method getRawModel(). This Model wont contain the inferred statements, it will contain only the axioms in the file. use a check against that. If you are using the OntModel it has got a method getBaseModel().
To preserve djthequest's answer from a comment:
Jena InfModel has a method getRawModel(). This Model wont contain the
inferred statements, it will contain only the axioms in the file. use
a check against that. If you are using the OntModel it has got a
method getBaseModel().
and Christian Wartena's response indicating that this was a solution:
Thanks. This works fine! I didn't find that method when I was reading
the documentation last week.
(I'll remove this answer if djthequest posts one.)