You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Steve Vestal <st...@galois.com> on 2022/12/29 14:31:31 UTC

Question about RDF Frames

Below is an example from 
https://jena.apache.org/documentation/notes/rdf-frames.html (rewritten 
in ofn due to minor syntax error in example and my greater familiarity 
with ofn), with one minor addition.  I declared an object property that 
is not used anywhere else.

Prefix(purl:=<http://purl.org/dc/elements/1.1#>)
Prefix(rf:=<http://www.adventium.com/rdf_frame_ofn#>)
Ontology( <http://www.galois.com/rdf_frame_ofn>
     Annotation( purl:title "Test RDF Frames" )

      Declaration( Class( rf:LivingThing ) )
      Declaration( Class( rf:Animal ) )
      SubClassOf(rf:Animal rf:LivingThing  )
      Declaration( Class( rf:Mammal ) )
      SubClassOf(rf:Mammal rf:Animal  )
      Declaration( ObjectProperty ( rf:hasSkeleton ) )
      ObjectPropertyDomain( rf:hasSkeleton rf:Animal )

      Declaration( ObjectProperty ( rf:unused ) )    # added to example
)

When I call OntClass.listDeclaredProperties, the rf:unused property 
appears in the list for all the classes in the ontology. Otherwise it 
behaves as in the example.  I have done some other simple tests, and it 
seems to list almost all the properties in the ontology for all 
classes.  What I would like to do is have it list for a class only the 
properties that are known (can be proven) to be used in the definition 
of that class, e.g., where removal of that property might change what 
appears in the ABox for a particular knowledge base.  I would appreciate 
help understanding this behavior and how I might get something closer to 
the desired list.  Where am I getting bitten by the open world assumption?



Re: Question about RDF Frames

Posted by Steve Vestal <st...@galois.com>.
Thanks, Lorenz.Setting direct to true results in LivingThing having 
property unused, Animal having property hasSkeleton, and Mammal having 
no direct property.

I would appreciate a sanity check on my current understanding of, “In 
summary, for the purposes of this HOWTO we define the /properties of a 
class/ as just those properties that don’t entail any new type 
information when applied to resources that are already known to be of 
that class.”Is the following correct?

“Any new type information” means a named individual could be added to a 
class C by adding a property assertion to the ABox.There exists a 
property assertion that would cause either the subject or the object of 
that property assertion to be added to class C by the reasoner.Or does 
this apply only when the subject/domain named individual might be added 
to class C?

“Of that class” means that additional property assertions of named 
individuals could add individuals to other classes, as long as the 
reasoner can prove no existing named individuals could be added to class 
C by adding any (consistent) property assertion.

Given a class C, an individual x that is asserted or entailed to be a 
member of C, and a property p: if for any named individual y there 
exists a new property assertion <x p y> or <y p x> that if added would 
cause the reasoner to add some named individual in the ABox to class C, 
then p is not a property of class C.Class C has property p only if, for 
all possible pairs (x, y) of named individuals, membership in class C of 
both x and y has been fully determined using existing ABox property 
assertions.This is sort of a fixed-point, anti-monotonic behavior; p is 
a property of C if the reasoner can prove that adding additional <x, p, 
y> property assertions cannot add members to class C.

“What simple domain constraints are entailed [for a given property p]” 
means the set of named individuals that are members of the domain of 
p.All named classes and class expressions that are known to be direct 
subclasses of that (possibly unnamed) domain set will have that 
property. In the given example where the domain is A intersect B, 
neither A nor B have that property because each of them might have 
elements that fall outside that intersection.For A union B, both A and B 
have that property (directly or inherited) because both are subclasses 
of that union domain.

These rules tend to associate a property p with more general/broad 
classes, classes that already contain a large number of individuals with 
property p assertions.Looking at the TBox subclass hierarchy, property 
associations tend to percolate up the class hierarchy to the classes 
where the reasoner can prove that no further <x p y> assertions could 
add either x or y to the given class.

The properties of a class depend on the ABox assertions of properties 
for pairs of named individuals and on whether the selected reasoner is 
able to infer that no additional <x p y> assertions could add more 
classifications.The fewer the existing property assertions, the weaker 
the reasoner, with an open world assumption, then the greater the 
tendency for property associations to percolate up the subclass hierarchy.

The direct parameter in listDeclaredProperties controls whether a 
property p of a class C should be listed for subclasses of C or only for 
C itself.This determines whether a direct property of a class is listed 
for subclasses of that class.

In the following example, almost all the defining properties percolate 
up to all the direct subclasses of owl:Thing.domainHasClassF is the only 
property that is not listed for all the classes.This could be due to the 
fact that there are very few ABox property assertions on named 
individuals, lots of room left to make lots of property assertions.

Prefix(purl:=<http://purl.org/dc/elements/1.1#>)
Prefix(dp:=<http://www.adventium.com/defprops#>)
Ontology( <http://www.galois.com/defprops>
     Annotation( purl:title "Test Defining Properties" )

     # Properties asserted on members of a class
     ClassAssertion( dp:ContainsIA1 dp:IA1 )
     ClassAssertion( dp:ContainsIB1 dp:IB1 )
     ObjectPropertyAssertion( dp:propIA1toIB1 dp:IA1 dp:IB1)
     ObjectPropertyAssertion( dp:propIB1toIA1 dp:IB1 dp:IA1)

     # Classes defined using property restrictions
      Declaration( Class( dp:SomeFromThisClass ) )
      Declaration( Class( dp:OnlyFromThisClass ) )
     Declaration( ObjectProperty ( dp:some ) )
     Declaration( ObjectProperty ( dp:only ) )
     EquivalentClasses (dp:ClassHasSomeFrom ObjectSomeValuesFrom( 
dp:some dp:SomeFromThisClass ) )
     EquivalentClasses (dp:ClassHasOnlyFrom ObjectAllValuesFrom( dp:only 
dp:OnlyFromThisClass ) )

     #Classes with declared property range
     # shorthand for SubClassOf( owl:Thing ObjectAllValuesFrom( 
dp:rangeHasClassER dp:ClassE ) )
     Declaration( ObjectProperty ( dp:rangeHasClassE ) )
     ObjectPropertyRange( dp:rangeHasClassE dp:ClassE )

     #Classes with declared property domain
     # shorthand for SubClassOf( ObjectSomeValuesFrom( 
dp:domainHasClassF owl:Thing ) dp:ClassF )
     Declaration( ObjectProperty ( dp:domainHasClassF ) )
     ObjectPropertyDomain( dp:domainHasClassF dp:ClassF )

     # Properties that are not known to be a defining property of any class
     Declaration( ObjectProperty ( dp:unused ) )

)


On 12/30/2022 1:22 AM, Lorenz Buehmann wrote:
> Hi Steve,
>
> In the documentation you referred to, the important statement is at 
> the bottom:
>
>> Global properties listDeclaredProperties will treat properties with 
>> no specified domain as global, and regard them as properties of all 
>> classes. The use of the direct flag can hide global properties from 
>> non-root classes.
> The general idea is, that if no domain is defined for the property, 
> then we cannot assume it doesn't "belong" to any class A - indeed, using
>
> cls.listDeclaredProperties(true)
>
> would avoid that assumption, and only return all those properties 
> without a domain for the root class only.
>
>
> Cheers,
>
> Lorenz
>
> On 29.12.22 15:31, Steve Vestal wrote:
>> Below is an example from 
>> https://jena.apache.org/documentation/notes/rdf-frames.html 
>> (rewritten in ofn due to minor syntax error in example and my greater 
>> familiarity with ofn), with one minor addition.  I declared an object 
>> property that is not used anywhere else.
>>
>> Prefix(purl:=<http://purl.org/dc/elements/1.1#>)
>> Prefix(rf:=<http://www.adventium.com/rdf_frame_ofn#>)
>> Ontology( <http://www.galois.com/rdf_frame_ofn>
>>     Annotation( purl:title "Test RDF Frames" )
>>
>>      Declaration( Class( rf:LivingThing ) )
>>      Declaration( Class( rf:Animal ) )
>>      SubClassOf(rf:Animal rf:LivingThing  )
>>      Declaration( Class( rf:Mammal ) )
>>      SubClassOf(rf:Mammal rf:Animal  )
>>      Declaration( ObjectProperty ( rf:hasSkeleton ) )
>>      ObjectPropertyDomain( rf:hasSkeleton rf:Animal )
>>
>>      Declaration( ObjectProperty ( rf:unused ) )    # added to example
>> )
>>
>> When I call OntClass.listDeclaredProperties, the rf:unused property 
>> appears in the list for all the classes in the ontology. Otherwise it 
>> behaves as in the example.  I have done some other simple tests, and 
>> it seems to list almost all the properties in the ontology for all 
>> classes.  What I would like to do is have it list for a class only 
>> the properties that are known (can be proven) to be used in the 
>> definition of that class, e.g., where removal of that property might 
>> change what appears in the ABox for a particular knowledge base.  I 
>> would appreciate help understanding this behavior and how I might get 
>> something closer to the desired list.  Where am I getting bitten by 
>> the open world assumption?
>>
>>

Re: Question about RDF Frames

Posted by Lorenz Buehmann <bu...@informatik.uni-leipzig.de>.
Hi Steve,

In the documentation you referred to, the important statement is at the 
bottom:

> Global properties listDeclaredProperties will treat properties with no 
> specified domain as global, and regard them as properties of all 
> classes. The use of the direct flag can hide global properties from 
> non-root classes.
The general idea is, that if no domain is defined for the property, then 
we cannot assume it doesn't "belong" to any class A - indeed, using

cls.listDeclaredProperties(true)

would avoid that assumption, and only return all those properties 
without a domain for the root class only.


Cheers,

Lorenz

On 29.12.22 15:31, Steve Vestal wrote:
> Below is an example from 
> https://jena.apache.org/documentation/notes/rdf-frames.html (rewritten 
> in ofn due to minor syntax error in example and my greater familiarity 
> with ofn), with one minor addition.  I declared an object property 
> that is not used anywhere else.
>
> Prefix(purl:=<http://purl.org/dc/elements/1.1#>)
> Prefix(rf:=<http://www.adventium.com/rdf_frame_ofn#>)
> Ontology( <http://www.galois.com/rdf_frame_ofn>
>     Annotation( purl:title "Test RDF Frames" )
>
>      Declaration( Class( rf:LivingThing ) )
>      Declaration( Class( rf:Animal ) )
>      SubClassOf(rf:Animal rf:LivingThing  )
>      Declaration( Class( rf:Mammal ) )
>      SubClassOf(rf:Mammal rf:Animal  )
>      Declaration( ObjectProperty ( rf:hasSkeleton ) )
>      ObjectPropertyDomain( rf:hasSkeleton rf:Animal )
>
>      Declaration( ObjectProperty ( rf:unused ) )    # added to example
> )
>
> When I call OntClass.listDeclaredProperties, the rf:unused property 
> appears in the list for all the classes in the ontology. Otherwise it 
> behaves as in the example.  I have done some other simple tests, and 
> it seems to list almost all the properties in the ontology for all 
> classes.  What I would like to do is have it list for a class only the 
> properties that are known (can be proven) to be used in the definition 
> of that class, e.g., where removal of that property might change what 
> appears in the ABox for a particular knowledge base.  I would 
> appreciate help understanding this behavior and how I might get 
> something closer to the desired list.  Where am I getting bitten by 
> the open world assumption?
>
>