Identification of templates

Message
Author
vvagr
Posts: 282
Joined: Mon Feb 27, 2012 11:01 pm
Location: Moscow, Russia
Contact:

Identification of templates

#1 Post by vvagr »

As discussed in MMT SIG and P8IWG, see below samples of template definition and template instance presumably compliant to JORD ID spec.

One simple template is selected - Classification.

Template and template roles have human-readable fragment identifiers as part of URI.

Template and template roles have UUIDs assigned via pca:defaultRdsId predicate.

Template instance is self-explanatory.

Please comment on these examples. Are they correct? Are there enough data for tools developed?

Samples below can be cut-and-pasted into a text file with .rdf extension. Is it enough or sandbox endpoint is required by any testers?

Classification template:

Code: Select all

<?xml version="1.0"?>

<!DOCTYPE rdf:RDF [
  <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
  <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
  <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
  <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
  <!ENTITY p7tm "http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/p7tm#" >
  <!ENTITY dm "http://rds.posccaesar.org/2008/02/OWL/ISO-15926-2_2003#" >
  <!ENTITY pca "http://posccaesar.org/rdl/" >
]>

<rdf:RDF 
  xmlns="http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/p7tpl#"
  xml:base="http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/p7tpl"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  xmlns:owl="http://www.w3.org/2002/07/owl#"
  xmlns:p7tm="http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/p7tm#"
  xmlns:dm="http://rds.posccaesar.org/2008/02/OWL/ISO-15926-2_2003#"
  xmlns:pca=" http://posccaesar.org/rdl/"
>

<owl:Class rdf:about="#Classification">
<rdfs:label>Classification</rdfs:label>
<pca:defaultRdsId>R-2d0daa18-30e0-49b7-aaa8-2ba433cb817a</pca:defaultRdsId>
<rdfs:comment>This class represents the ISO 15926-7 proto-template ClassificationTemplate.</rdfs:comment>
<rdfs:subClassOf rdf:resource="&p7tm;BaseTemplateStatement" />
<rdfs:subClassOf>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<owl:Restriction>
<owl:onProperty rdf:resource="#hasClassifier" />
<owl:allValuesFrom rdf:resource="&dm;Class" />
</owl:Restriction>
<owl:Restriction>
<owl:onProperty rdf:resource="#hasClassifier" />
<owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality>
<owl:onClass rdf:resource="&dm;Class" />
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</rdfs:subClassOf>
<rdfs:subClassOf>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<owl:Restriction>
<owl:onProperty rdf:resource="#hasClassified" />
<owl:allValuesFrom rdf:resource="&dm;Thing" />
</owl:Restriction>
<owl:Restriction>
<owl:onProperty rdf:resource="#hasClassified" />
<owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality>
<owl:onClass rdf:resource="&dm;Thing" />
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</rdfs:subClassOf>
</owl:Class>
<p7tm:TemplateDescription rdf:about="#Classification__desc">
<rdf:type rdf:resource="&owl;Thing" />
<p7tm:valNumberOfRoles rdf:datatype="&xsd;integer">2</p7tm:valNumberOfRoles>
<p7tm:hasTemplate rdf:resource="#Classification" />
</p7tm:TemplateDescription>
<p7tm:TemplateRoleDescription rdf:about="#Classification__rdesc2">
<rdf:type rdf:resource="&owl;Thing" />
<p7tm:valRoleIndex rdf:datatype="&xsd;integer">2</p7tm:valRoleIndex>
<p7tm:hasRoleFillerType rdf:resource="&dm;Class" />
<p7tm:hasTemplate rdf:resource="#Classification" />
<p7tm:hasRole rdf:resource="#hasClassifier" />
</p7tm:TemplateRoleDescription>
<p7tm:TemplateRoleDescription rdf:about="#Classification__rdesc1">
<rdf:type rdf:resource="&owl;Thing" />
<p7tm:valRoleIndex rdf:datatype="&xsd;integer">1</p7tm:valRoleIndex>
<p7tm:hasRoleFillerType rdf:resource="&dm;Thing" />
<p7tm:hasTemplate rdf:resource="#Classification" />
<p7tm:hasRole rdf:resource="#hasClassified" />
</p7tm:TemplateRoleDescription>
<owl:ObjectProperty rdf:about="#hasClassifier">
<rdfs:label>hasClassifier</rdfs:label>
<pca:defaultRdsId>R-43f790b7-9370-407b-ad6a-a07d34d3ef82</pca:defaultRdsId>
<rdfs:subPropertyOf rdf:resource="&p7tm;hasObjectRoleFiller" />
</owl:ObjectProperty>
<owl:ObjectProperty rdf:about="#hasClassified">
<rdfs:label>hasClassified</rdfs:label>
<pca:defaultRdsId>R-a63e7771-bd9b-4621-9015-93e91039ef54</pca:defaultRdsId>
<rdfs:subPropertyOf rdf:resource="&p7tm;hasObjectRoleFiller" />
</owl:ObjectProperty>
</rdf:RDF>
Template instance:

Code: Select all

<?xml version="1.0"?>

<!DOCTYPE rdf:RDF [
  <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
  <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
  <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
  <!ENTITY p7tpl "http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/p7tpl#" >
  <!ENTITY pcardl "http://posccaesar.org/rdl/" >
]>

<rdf:RDF 
  xmlns="http://example.org/rdl#"
  xml:base="http://example.org/rdl"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  xmlns:owl="http://www.w3.org/2002/07/owl#"
  xmlns:p7tpl="http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/p7tpl#"
  xmlns:pcardl="http://posccaesar.org/rdl/"
>
<rdf:Description rdf:about="#id63e30338-945b-4d03-aa6e-7d169b6211e3">
<rdfs:label>classification_sample</rdfs:label>
<rdf:type rdf:resource="&p7tpl;Classification" />
<rdf:type rdf:resource="&owl;Thing" />
<p7tpl:hasClassified rdf:resource="&pcardl;RDS327239" />
<p7tpl:hasClassifier rdf:resource="&pcardl;RDS208394" />
</rdf:Description>
</rdf:RDF> 

RobinBenjamins
Posts: 59
Joined: Tue Jan 08, 2013 12:08 pm

Re: Identification of templates

#2 Post by RobinBenjamins »

These are correct from my understanding and should be used as a reference for all other templates to follow. Next step is to use the ID patterns in this example to update the hosted sandboxes in JORD.

HansTeijgeler
Posts: 283
Joined: Sun Jan 22, 2012 10:02 pm

Re: Identification of templates

#3 Post by HansTeijgeler »

Hi,

So far we have used this style:

Code: Select all

<p7tpl:Classification rdf:ID="id63e30338-945b-4d03-aa6e-7d169b6211e3">
    <rdfs:label>classification_sample</rdfs:label>
    <rdf:type rdf:resource="&owl;Thing" />
    <p7tpl:hasClassified rdf:resource="&pcardl;RDS327239"/>
    <p7tpl:hasClassifier rdf:resource="&pcardl;RDS208394" />
</p7tpl:Classification>
The style now proposed:

Code: Select all

<rdf:Description rdf:about="#id63e30338-945b-4d03-aa6e-7d169b6211e3">
     <rdfs:label>classification_sample</rdfs:label>
     <rdf:type rdf:resource="&p7tpl;Classification" />
     <rdf:type rdf:resource="&owl;Thing" />
     <p7tpl:hasClassified rdf:resource="&pcardl;RDS327239" />
     <p7tpl:hasClassifier rdf:resource="&pcardl;RDS208394" />
</rdf:Description>
gives exactly the same triples (see side note 3 below).

The reason why Victor proposed the second style is because his tool produces that, and that is because he built it that way.
The use of rdf:Description is not mandatory.

The first style, used by us so far, has the advantage of quick recognition in a listing by a human being, because it starts with telling what template it is an instance of.

My urgent request is to accept both styles. Technically they are equivalent.

Some side notes:
1) The RDF world sticks to declaring with rdf:ID and later addition of information with rdf:about="#[earlier declared ID]"; I checked that on semanticweb.com
2) ID's shall start with a letter, UUIDs often start with a number; so far we added the prefix C for owl:Class and T for owl:Thing, but that is only convention.
3) There is no template called Classification. The one shown corresponds with ClassificationOfClassOfIndividual, but that has one more role. So do not take my example too literally, because it is incorrect and only there to show the difference in style.
4) The use of ClassificationOfClassOfIndividual and other templates in the RDL has not, so far, been implemented. I strongly advise first to agree on the set of base templates.

vvagr
Posts: 282
Joined: Mon Feb 27, 2012 11:01 pm
Location: Moscow, Russia
Contact:

Re: Identification of templates

#4 Post by vvagr »

Hans,

The only goal of this example was to demonstrate the way to use predicate pca:defaultRdsId. Everything else was indeed driven by the tool at hand.
My urgent request is to accept both styles. Technically they are equivalent.
I don't think there is special need for such declarations. They are both correct RDF, I believe there is some formal proof they're the same N3. The tools have to understand both styles if they are compliant to W3C standards, without any references to ISO 15926.
1) The RDF world sticks to declaring with rdf:ID and later addition of information with rdf:about="#[earlier declared ID]"; I checked that on semanticweb.com
That's RDF/XML conventions. Do they have any meaning in triples/SPARQL paradigm? I honestly don't know!
2) ID's shall start with a letter, UUIDs often start with a number; so far we added the prefix C for owl:Class and T for owl:Thing, but that is only convention.
"R-" is used because it is specifically an example of JORD ID spec implementation.
3) There is no template called Classification. The one shown corresponds with ClassificationOfClassOfIndividual, but that has one more role. So do not take my example too literally, because it is incorrect and only there to show the difference in style.
Template called Classification exists in P7 attachment p7tpl.owl and is widely (and I believe officially?) distributed with the standard. I hope that http://standards.iso.org/iso/ts/15926/- ... sification will forever remain its URI, or will be officially revoked by ISO. Otherwise we'll be in big trouble.

HansTeijgeler
Posts: 283
Joined: Sun Jan 22, 2012 10:02 pm

Re: Identification of templates

#5 Post by HansTeijgeler »

Hi Victor,

I haven't seen any pca:defaultRdsId.

The Classification you refer to is a proto template, that is used in the First-Order Logic of lifted templates as ClassificationTemplate, not in between lowered templates in a Part 8 file.

vvagr
Posts: 282
Joined: Mon Feb 27, 2012 11:01 pm
Location: Moscow, Russia
Contact:

Re: Identification of templates

#6 Post by vvagr »

I haven't seen any pca:defaultRdsId.
It is there among properties of roles and template itself, not in an instance part of an example. It was one of the problems - whether iRING Tools users need some instance format which is not really RDF. Looks like they are happy with RDF (because they don't use it).
The Classification you refer to is a proto template, that is used in the First-Order Logic of lifted templates as ClassificationTemplate, not in between lowered templates in a Part 8 file.
That puzzles me. If I want to express simple fact of classification - can't I just use this one?

HansTeijgeler
Posts: 283
Joined: Sun Jan 22, 2012 10:02 pm

Re: Identification of templates

#7 Post by HansTeijgeler »

Hi Victor,

From the very beginning of implementing ISO 15926 in OWL and RDF the OWLites have complained about the Part 2 Relationships and ClassOfRelationships. They see those as subtypes of rdf:Property (I don't). In RDF instances of rdf:Property can be used neither as rdf:subject nor as rdf:object, so in their view one cannot address a Part 2 Relationship. Looking at all templates it is evident that there is an incompatibility.

So, Johan came with a workaround. In Annex C of part 7 you find prototemplates like these:

Code: Select all

ClassificationTemplate(y, z) <->
exists u(ClassificationTriple(u, y, z)) .
(if you see a ClassificationTemplate with attributes y and z then that is equivalent to a ClassificationTriple u with attributes y and z.
That ClassificationTriple (below) is equivalent to a Classification x AND a Property hasClassified y AND a Property hasClassifier z.)

Code: Select all

ClassificationTriple(x, y, z) <-> 
Classification(x) ^ hasClassified(x, y) ^ hasClassifier(x, z) .
These are used in the FOL code for the defining Lifted Template, that you find in every template specification: the XxxTriple in case you need to address it, and the XxxTemplate in case not.

In some exceptional cases, like Approval, a Relationship would have to be addressed. In those templates I have avoided that by putting the two objects of such relationship in the signature, instead of that relationship.
If I want to express simple fact of classification - can't I just use this one?
Well, that depends on the acceptance of the approx. 250 template specifications on 15926.org. These have been crafted such that information integration is made possible. Mixing those with prototemplates will render erratic query results.

vvagr
Posts: 282
Joined: Mon Feb 27, 2012 11:01 pm
Location: Moscow, Russia
Contact:

Re: Identification of templates

#8 Post by vvagr »

Well, that depends on the acceptance of the approx. 250 template specifications on 15926.org. These have been crafted such that information integration is made possible. Mixing those with prototemplates will render erratic query results.
Agreed. Templates designed for life-cycle information integration do not mix well with basic sets designed for data exchange only.

geizahamazaki
Posts: 16
Joined: Thu Mar 08, 2012 12:39 pm

Re: Identification of templates

#9 Post by geizahamazaki »

Hi Victor,

I saw your sample of template definition and template instance. I have some comments:

At the Classification template, we have this code:

<p7tm:TemplateDescription rdf:about="#Classification__desc">

<rdf:type rdf:resource="&owl;Thing" />

<p7tm:valNumberOfRoles rdf:datatype="&xsd;integer">2</p7tm:valNumberOfRoles>

<p7tm:hasTemplate rdf:resource="#Classification" />

</p7tm:TemplateDescription>


I think that "Classification_desc" is an instance of Template Description, isn´t it?
I disagree of this syntax, because the Template Description is a class declared at the p7tm. p7tm:TemplateDescription is not a tag declared at some
XMLSchema or DTD file to be used as shown above.

At the p7tpl.owl file we have two different types of individual Declaration, as the samples bellow:

1-
<!-- http://standards.iso.org/iso/ts/15926/- ... dividual_2 -->

<p7tm:TemplateRoleDescription rdf:about="#TemplateRoleDescription_of_AssemblyOfIndividual_2">
<rdf:type rdf:resource="&owl;Thing"/>
<rdfs:label
>TemplateRoleDescription_of_AssemblyOfIndividual_2</rdfs:label>
<p7tm:valRoleIndex rdf:datatype="&xsd;integer">2</p7tm:valRoleIndex>
<p7tm:hasRoleFillerType rdf:resource="&dm;ArrangedIndividual"/>
<p7tm:hasTemplate rdf:resource="#AssemblyOfIndividual"/>
<p7tm:hasRole rdf:resource="#hasWhole"/>
</p7tm:TemplateRoleDescription>


Your sample follows the sample above.

2-
<!-- http://standards.iso.org/iso/ts/15926/- ... dividual_1 -->

<owl:Thing rdf:about="#TemplateRoleDescription_of_AssemblyOfIndividual_1">
<rdf:type rdf:resource="&p7tm;TemplateRoleDescription"/>
<rdfs:label
>TemplateRoleDescription_of_AssemblyOfIndividual_1</rdfs:label>
<p7tm:valRoleIndex rdf:datatype="&xsd;integer">1</p7tm:valRoleIndex>
<p7tm:hasRoleFillerType rdf:resource="&dm;PossibleIndividual"/>
<p7tm:hasTemplate rdf:resource="#AssemblyOfIndividual"/>
<p7tm:hasRole rdf:resource="#hasPart"/>
</owl:Thing>


I think that the sample 2 is right , but I prefer to use the owl:NamedIndividual than owl:Thing, because
owl:Thing is a class of all instances[1], it can be identified or anonimous individual, and owl:NamedIndividual is an entity declarations to express that individuals that are identified by an IRI[2].

[1]http://www.w3.org/TR/2004/REC-owl-guide ... ndividuals
[2]http://www.w3.org/TR/owl2-quick-reference/


Regards,
Geiza

vvagr
Posts: 282
Joined: Mon Feb 27, 2012 11:01 pm
Location: Moscow, Russia
Contact:

Re: Identification of templates

#10 Post by vvagr »

Hi Geiza,
p7tm:TemplateDescription is not a tag declared at some XMLSchema or DTD file to be used as shown above.
This type of XML is allowed by the standard: http://www.w3.org/TR/rdf-syntax-grammar ... yped-nodes . There is no formal difference whether to start declaration of an object in RDF/XML with rdf:Description or with any of object's types. And the difference is relevant in XML only, triples are the same whether returned by SPARQL or in N3/Turtle notation.

We may agree on some convention, but W3C-compliant tools should not differentiate. And there is an argument in favour of starting description of an element with template type - it really increases human readability of a dataset.

Concerning owl:NamedIndividual - I don't have any opinion. But rigorous use of OWL 2 constructs has sense only in models which are OWL 2 models in other aspects. Can you really use OWL reasoner/verifier software to check template definition model which combines template and role declarations with meta-template instances we're discussing here?

Post Reply