0

In DL (and OWL-DL): Given a TBox, two concepts C1 and C2, in my problem, we say that a path exists between C1 and C2 if and only if:

C1 ⊑ =1 r.C2     where r is a single/composite role (role chain)

i.e. if r is a single role then we must have each instance of C1 related to exactly one instance of C2 through r; otherwise (r is composite) then each instance of C1 is related to exactly one instance of C2 through a composition of roles i.e. (r1*r2*r3...) if we consider * stands for role composition.

My question is: Is the Graph sense the best way to accomplish this task using OWL API, where graph nodes stand for concepts and edges stand for object properties. Then we start from C1 node and perform a breadth-first search until we reach C2. This is my idea! Is there any better way to perform this?

This problem is generally about fining paths which have specific characteristics between two ontology concepts. For the ease of understaning, you can eliminate the exactly one restriction. Thus

C1 ⊑ ∃ r.C2

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
Median Hilal
  • 1,483
  • 9
  • 17
  • 1
    I'm not sure offhand, but I *think* that if you have an axiom like `C1 subClassOf (p o q) exactly 1 C2`, i.e., the kind of axiom you're talking about, then you're not in OWL-DL anymore, because of the restrictions on where complex properties can appear. – Joshua Taylor Dec 22 '14 at 15:34
  • 2
    It helps very much that you provided the sample axiom, but I'm not exactly clear what you're asking. Are you asking to find C1, C2, and values of r such that "C1 ⊑ =1 r.C2"? You can't do that through a search on an RDF graph of some instance data, because such graph is only one model of the data. – Joshua Taylor Dec 22 '14 at 15:38
  • 1
    You *could*, I suppose, start from a class A, and then iterate through declared relations r and classes B asking *whether* (A subClassOf r exactly 1 B). Of course, in that case, you'll still have the issue of class and relation *expressions* (i.e., non-atomic classes like (A or (B and (not C))) and relations like (inverse r)). – Joshua Taylor Dec 22 '14 at 15:41
  • 1
    Your last "axiom", "C1 ⊑ r.C2", doesn't make sense, because "r.C2" isn't a class expression. – Joshua Taylor Dec 22 '14 at 15:43
  • 1
    For the the last axiom I edited it, I meant C1 ⊑ ∃r.C2. – Median Hilal Dec 22 '14 at 18:56
  • For the basic question, consider C1 and C2 are constants, and I'm searching for all r such that C1 ⊑ =1 r.C2. – Median Hilal Dec 22 '14 at 18:57
  • 1
    Finding such values of r isn't a typical DL reasoner task, though some reasoners might support it. You'd still have to, I think, iterate through the properties that you know, and ask about each one. – Joshua Taylor Dec 22 '14 at 18:58
  • Besides, I have no individuals in my ontology, just the TBox. – Median Hilal Dec 22 '14 at 18:58
  • Well, then is a graph the best way as I mentioned in the basic question? – Median Hilal Dec 22 '14 at 18:59
  • 1
    OK, will any of the "A subClassOf r exactly 1 B" links be inferred, or all explicitly declared? If they'll all be explicitly declared, then it sounds like just retrieving all of those, and building a graph and doing a graph search might be the best way to do this. – Joshua Taylor Dec 22 '14 at 18:59
  • explicitly declared, if not, I need to do that at some stage before launching this work. – Median Hilal Dec 22 '14 at 19:00
  • 1
    OK, so if they're all explicitly declared, you can simply ask for all A, r, and B, such that (A subClassOf r exactly 1 B), and do a graph search (BFS or DFS, doesn't really matter if you want *all* paths, since the graph is finite and you won't follow cycles) to enumerate the paths. – Joshua Taylor Dec 22 '14 at 19:03
  • That sounds good, but at each step, I can only ask for r such that A, such that (A subClassOf r exactly 1 B) (A and B are constants). – Median Hilal Dec 22 '14 at 19:04
  • I mean at each iteration, only **one** simple objectProberty r can be discovered a time, and the graph sense is for the composition. Is this right? – Median Hilal Dec 22 '14 at 19:05
  • 1
    You said you'd have all the axioms of that form declared in advance. You can just construct a graph from them with one edge per axiom. – Joshua Taylor Dec 22 '14 at 19:05
  • Yes, by 'discovered', I mean 'processed'. – Median Hilal Dec 22 '14 at 19:08
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/67492/discussion-between-median-hilal-and-joshua-taylor). – Median Hilal Dec 22 '14 at 19:11
  • Please a last question, if they are not clearly declared, what is the other idea? an please move your comment about that using graph is the right way to an answer in order to tick it as a solution. – Median Hilal Dec 22 '14 at 19:12
  • 1
    It depends. You might have a reasoner which can find values for r such that (A subClassOf r exactly 1 B). If you don't have a reasoner that can do that, then you could iterate through the properties and chains and classes that appear in your ontology and ask whether for each r and B it is true that (A subClassOf r exactly 1 B). – Joshua Taylor Dec 22 '14 at 19:23
  • But again, even if I have this reasoner, it can be used for a simple role r, each time. i.e. this reasoner cannot be used for chains. Again chains need iteration or graph etc. – Median Hilal Dec 22 '14 at 19:27
  • 1
    That would depend on the reasoner, wouldn't it? – Joshua Taylor Dec 22 '14 at 19:49
  • Disregarding sparql, I think reasoners cannot handle composite roles. If it comes to sparql, using a reasoner for such a task makes sense. But for my problem, there are no individuals, so I think using sparql is not suitable. Am I right? – Median Hilal Dec 22 '14 at 19:56
  • (i) "I think reasoners cannot handle composite roles." I'm not sure what you mean here. They are part of of OWL-DL, and reasoners such as Pellet handle composite roles. E.g., if you assert that (A subClassOf p some B) and (B subClassOf q some C), you can infer that A subClassof some (p o q) C). (ii) "there are no individuals, so I think using sparql is not suitable" You can still use SPARQL to query the RDF serialization of your OWL ontology. That would help to retrieve all the edges in the graph that you need to traverse, but it won't help much for actually finding those paths. – Joshua Taylor Dec 22 '14 at 20:16
  • (i) I tried Protege 5.0 with Pellet out for " if you assert that (A subClassOf p some B) and (B subClassOf q some C), you can infer that A subClassof some (p o q) C)", it's not working. Anyway, regarding what you say, a reasoner cannot be used when those p and q are variables, i.e. it cannot be used to find p1 o p2 o ... o pn such that A subClassOf some p1 o p2 o ... o pn B. where p1, p2, ..., pn are not known – Median Hilal Dec 22 '14 at 20:48
  • 1
    Protege is not the only way to interact with Pellet. Pellet can be connected to SPARQL engines, which means that you *can* write SPARQL queries that use variables in the place of properties, and have Pellet provide solutions. There is more to reasoner interaction than Protege. – Joshua Taylor Dec 22 '14 at 21:04
  • Thanks for this valuable information. To conclude our discussion, having an ontology O and A and B concepts and in order to find all p such that p = p1 o p2 o ... o pn where A subClassOf some p1 o p2 o ... o pn B. We have to retrieve all classes and properties of the ontology and find some (programmatically) way to complete this task. A graph seems a suitable candidate. – Median Hilal Dec 22 '14 at 21:11

0 Answers0