gjhiggins/rdflib — Issue #171: Construct a SPARQL  query over two classes of a owl ontology and get the class that is defined by the two previous
Author: gjhiggins
Created: 2011-10-19 01:35:11+00:00
State: open

Originally filed by susana.m...@gmail.com on 2011-05-12T18:55:22

Definition of the problem:

construct a SPARQL query that for each line of the log file (attached) to return a subclass of PatternElement (defined in the ontology) to which this row belongs.

Each line of the log file can:
1 - contain only the name of a subclass of basic classes defined in the ontology
2 - bear the names of two subclasses of the basic classes defined in the ontology

The classes are designated in basic ontology Action, Participant, Message and Event.

In both cases, I intend to get what the subclass of PatternElement corresponding to each line of the file. In this case, all lines in the file are correct so that there is always a correspondence between the line and a subclass of PatternElement.

Next, I describe a practical example to illustrate what I said above.

Line of the log file (first line with two classes):

0 EventSend MessageActivityRequest

EventSend - subclass the base class Event
MessageActivityRequest - subclass the base class Message

Performing a SPARQL query with these two classes, I get what PatterElement corresponding subclass. In this case, the subclass is called SendActivityExecutionRequest and is defined in as follows in protégé:

PatternElement
hasComponent and some (or ParticipantRequestor ParticipantSender)
Exactly one and hasComponent EventSend
Exactly one and hasComponent MessageActivityRequest

This is the only class possible to match the line indicated. Moreover, for each line there is only one possible class.
In this case, I'm ignoring the classes Participant Sender and Participant Requestor, they are optional and do not appear in this log file.

The same class in the OWL file is represented as follows:

1

1

My goal is to write a SPARQL query to tell me what the subclass of PatternElement that has the following properties or relations, "hasComponent EventSend" and "hasComponent MessageActivityRequest"

Can tell me how to perform SPARQL queries which could achieve this result?

I am using protege 3.4.6 version to run SPARQL queries on the ontology, but I was used Protégé 4.0 to build. The log file and the file of the ontology are attached.

Thanks in advance,

Susana