[Pellet-users] Getting Properties with a given domain (corrected: sorry)

Ibach, Brandon L brandon.l.ibach at lmco.com
Thu Mar 15 01:32:38 UTC 2007


    Here's a possible answer on the "how" question.  Running this SPARQL query against simple.owl seems to return what you're looking for:
 
PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX :     <http://www.owl-ontologies.com/Ontology_simple.owl#>
SELECT ?p ?c WHERE { ?p rdf:type rdf:Property ; rdfs:domain ?c . :Class_1 rdfs:subClassOf ?c }

    That said, I understand better now what you're trying to do and agree about the inconsistent ontology point.  However, this approach assumes that you require the user to specify the type (class) of each individual before allowing them to specify property values, which may be fine (just mentioning it, since that isn't a general requirement when dealing with OWL data).  Also, given the possibility of complex class descriptions in the ontology, this approach might still not prevent an inconsistent ontology, since the values of other properties might alter the classification of the individual.  For instance, add the following to your example:
 
dataTypeProperty_3 hasDomain ParentClass
Class_2 equivalentClass [ onProperty dataTypeProperty_3 ; hasValue "Two" ]
Individual_1 dataTypeProperty_3 "Two"
 
    This will cause Individual_1 to be classified in Class_2, which conflicts with its declared type of Class_1.  Your approach could not prevent this, since dataTypeProperty_3 is allowed for any individual of type ParentClass, which Individual_1 is (since Class_1 is a subClass of ParentClass).
    This is not to say that your approach could not work, but rather that you could never be sure about the consistency of the ontology as the user edits it without actually running the reasoner against the data from time to time to verify things, just as you can do in Protege.
    Hope this helps...

-Brandon :) 

 

________________________________

From: arc at tid.es [mailto:arc at tid.es] 
Sent: Wednesday, March 14, 2007 11:18 AM
To: Ibach, Brandon L
Cc: pellet-users at lists.owldl.com
Subject: Re: [Pellet-users] Getting Properties with a given domain (corrected: sorry)


Hi Brandon,

Thanks for your answer.

However, I would like to offer an simple Individual editing interface to a user. Since it is a "user" ; ), I would like to offer the possibilities that do not leave the Ontology in an inconsistent state without having to do a try-error procedure. So for instance, if the ontology holds:

Class_1 isDisjointWith Class_2
dataTypeProperty_1 hasDomain Class_2

and I leave the user introduce the next assertions

Individual_1 type Class_1
Individual_1 dataTypeProperty_1 10

I would have an inconsistent ontology, wouldn't I?

Cheers,
Álvaro


Ibach, Brandon L escribió: 

	    I don't know much about the various APIs to Pellet, so I can't readily answer your "how" question, but I would like to point out one thing regarding the "why".  The semantics of a property domain in OWL are not about restricting what classes of individuals can have values for the property.  Rather, they are about inferring the class of an individual based on a property assertion.  So, if you assert that "individual_1 datatypeProperty_2 10" and "datatypeProperty_2 has domain Class_1", then the reasoner would infer that "individual_1 is a Class_1".  Perhaps this might affect what you're trying to do with the information about property domains.

	-Brandon :) 

	 

________________________________

	From: pellet-users-bounces at lists.owldl.com [mailto:pellet-users-bounces at lists.owldl.com] On Behalf Of Álvaro Ramos
	Sent: Wednesday, March 14, 2007 7:01 AM
	To: pellet-users at lists.owldl.com
	Subject: Re: [Pellet-users] Getting Properties with a given domain (corrected: sorry)
	
	
	Hi again,
	
	Now I am trying a slightly more complex ontology with a Datatype property that has as domain UnionOf(Class_1, Class_2)  (datatypeProperty_1) and another with domain Class_1 (datatypeProperty_2). The swoop's code returns only the simple:objectProp property both for the ParentClass and Class_1 arguments. I have developed a method based on the kb.hasDomain() method but then the answers are
	
	ParentClass (inherited=true):   all the properties in the ontology
	Class_1 (inherited=true):         all the properties in the ontology
	ParentClass (inherited=false):   datatypeProperty_1,datatypeProperty_2, objectProp
	Class_1 (inherited=false):         datatypeProperty_2
	
	
	>From here I deduce that the hasdomain method acts the opposite as I thought it to work, in the sense that 
	
	if domain(p) = c1 and c1 isSubClassOf c2 => hasdomain(p,c2) = true
	
	Is this true?
	
	I want to retrieve all the properties that could be associated to an individual of a given class (as subject and without leading to inferring that this individual is of another class or leaving the ontology in an inconsistent state). Specifically, I want all the properties (p) such that for a given class(c):
	domain(p)contains(c)
	
	That is, what Protegè shows in the properties view of a class... For Class_1:
	datatypeProperty_1
	datatypeProperty_2
	objectProp
	
	Is it possible to get this information from Pellet? I haven't got much experience with semantics and reasoners, so maybe this is a huge misconception and I should not be using Pellet (or a reasoner) for this.
	
	Best regards,
	Álvaro
	
	Álvaro Ramos escribió: 

		Hi Evren, 
		
		It helped a lot!
		
		Since in my example I am just using explicit declarations and no inference, the KnowledgeBase.ensureConcistency call did it. 
		
		Also (for the people that are interested) I have detected that the method I used has an obvious bug (if I understood the meaning of the argument 'inherited' correctly):
		
		line 
		
		Set allSubCSet = reasoner.descendantClassesOf(c);
		
		should be
		
		Set allSubCSet = reasoner.ancestorClassesOf(c);
		
		
		Thanks again!
		
		Álvaro
		
		
		
		
		
		
________________________________


		_______________________________________________
		Pellet-users mailing list
		Pellet-users at lists.owldl.com
		http://lists.owldl.com/mailman/listinfo/pellet-users
		_______________________________________________
		
		Sponsored by Clark & Parsia, LLC http://clarkparsia.com/


	-- 
	Álvaro Ramos
	
	Telefonica I+D
	Via Augusta, 177 
	08021 Barcelona
	
	Tel: (+34) 93 295 63 83
	Fax: (+34) 93 365 30 43
	
	"The future belongs to those who prepare for it today." 
	Malcom X 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.owldl.com/pipermail/pellet-users/attachments/20070315/52fbfb8a/attachment.htm 


More information about the Pellet-users mailing list