View unanswered posts | View active topics It is currently Wed Oct 24, 2018 1:27 am

 Page 1 of 1 [ 9 posts ]
The Template Expander (Lifting templates)
Author Message

Joined: Sun Jan 22, 2012 9:14 pm
Posts: 189
The Template Expander is an online tool made available on this site under Online Tools.
This is a short tutorial to get familiarized with its use.

This tutorial uses an example template: IdentificationOfTemporalPart.

This template is used for identification of a PossibleIndividual. In our example a vessel called 11V-101

The roles are:
1. (x1) hasTemporalWhole this is just an object e.g. with id = F12345 which is MyVessel
2. (x2) hasIdentified this is a temporal part e.g. with id = F22222 which is the temporal part for the identification
3. (x3) valIdentifier the string "11V-101"
4. (x4) valStartTime the date 07/11/2012

You can see the roles which are called x1 trough x4 in the model. For data exchange purposes it is sufficient that this information object is an n-ary relationship (template) expressed in a rule language for example:

IdentificationOfTemporalPart("F12345", "F22222", "11V-101", "07/11.2012")

or in RDF for example:
(where ex is some local namespace for the example)

ex:T12345 rdf:type p7tpl:IdentificationOfTemporalPart
ex:T12345 ex:hasTemporalWhole ex:F12345
ex:T12345 ex:hasIdentified ex:F22222
ex:T12345 ex:valIdentifier "P-101"^^xsd:string
ex:T12345 ex:valStartTime "07/11/2012"^^xsd:date

But to represent the diagram shown above the n-ary relationship needs to be lifted to know its true semantics. This is not necessary for the purpose of data exchange, but for the purpose of semantic precision, and only if this is required for a certain business case.

For this lifting action we can use the Template Expander.

The First Order Logic (FOL) axiom of this template is:
Code:
IdentificationOfTemporalPart(x1, x2, x3, x4) <->
PossibleIndividual(x1) &
PossibleIndividual(x2) &
ExpressString(x3) &
RepresentationOfGregorianDateAndUtcTime(x4) &
TemporalPartTemplate(x2, x1) &
ClassOfIdentificationTemplate(x3, x2) &
exists u(PointInTime(u) &
BeginningTemplate(u, x2) &
ClassOfIdentificationTemplate(x4, u)) .

(note: this FOL has a deliberate mistake)

There are two kinds of templates used in the FOL:
[*] Proto-Templates - these are a one-on-one representation of the ISO 15926-2 data model. Their name is the name of the entity data type followed by the suffix "Template" or "Triple".
[*] Base-Templates - these comprise of Proto-Templates and connect to entity data types.

In the above FOL code the following are proto-templates:
Temporal(Whole)PartTemplate, BeginningTemplate and ClassOfIdentificationTemplate.

There are no base-templates in this example (templates that comprise of proto-templates), but it would have been legal to have them in the axiom.

ACTIONS:
1. In the top-block of the template expander, behind all the axioms, we paste our new axiom.
2. In the center block we paste just the signature, so that is everything before the <-> sign of our axiom.
3. Click the Expand button.

The expanded (substitute all templates with their most explicit form) FOL axiom becomes:
Code:
PossibleIndividual(x1)
& PossibleIndividual(x2)
& ExpressString(x3)
& RepresentationOfGregorianDateAndUtcTime(x4)
& TemporalPartTemplate(x2, x1)
& exists z
(ClassOfIdentification(z) & hasPattern(z, x3) & hasRepresented(z, x2)
& exists u
(PointInTime(u)
& exists z (Beginning(z) & hasPart(z, u) & hasWhole(z, x2))
& exists z
(ClassOfIdentification(z) & hasPattern(z, x4) & hasRepresented(z, u)))

The Expand program first did a syntax check. In this case it did not come with a syntax error, or it would have given the error and line number, and not the expanded logic.

All templates (ending with "Template" or "Triple") should have been expanded through their proto template statements. No "Template" or "Triple" should be there any more.

However, there is a mistake. The TemporalPartTemplate(x2, x1) was not expanded.
Checking the proto templates, you will find that the correct name is TemporalWholePartTemplate(x2, x1). Correcting the error, and expanding once again, we arrive at the correct end-result.

Code:
PossibleIndividual(x1)
& PossibleIndividual(x2)
& ExpressString(x3)
& RepresentationOfGregorianDateAndUtcTime(x4)
& exists z (TemperalWholePart(z) & hasPart(z, x2) & hasWhole(z, x1))
& exists z
(ClassOfIdentification(z) & hasPattern(z, x3) & hasRepresented(z, x2)
& exists u
(PointInTime(u)
& exists z (Beginning(z) & hasPart(z, u) & hasWhole(z, x2))
& exists z
(ClassOfIdentification(z) & hasPattern(z, x4) & hasRepresented(z, u)))

The final action to take is to check if this FOL actually translates the diagram completely.

If this axiom is approved, it can be added to all-templates.txt and uploaded by the upload button.

Note that the template expander has a bug: it is not possible to copy/paste between it and an external editor. So it is also not possible to copy the output back into your Word document or email.

This bug is caused by a later update of Java. Copy/paste was regarded a security risk.

If you want to enable copy/paste to Java Applets you have to set up a policy on your own computer.

Here are the instructions:
• on Windows XP this is folder: C:\Documents and Settings\<your user ident>\
• on Windows 7 this is folder: C:\Users\<your user ident>\
• Check that the file is really there, and really called .java.policy (mind the dot at the front)

Wed Jul 11, 2012 1:41 pm

Joined: Mon May 07, 2012 1:20 pm
Posts: 10
Hi,

(This is only marginally on topic, but here goes!)

I recently wrote a tool to do checking of Part7-like axioms with and old version of Vampire (a FOL reasoner). However, I found that with all the axioms loaded, it was hopelessly slow. There are probably solutions to this, but I wonder whether it is worth pursuing.

Question: Given that the constraints in Part 2 are just about the types of role fillers and the composition of classes, is it really necessary to use a FOL reasoner to validate templates? (I see Prover9 referenced in the description of this tool.)

I think that maybe trying to expand to example populations and using purpose-built code to check the role-filling and AND constraints would be sufficient. In fact, many years ago I wrote a program called Expresso that does exactly that kind of checking -- it would validate populations with respect to EXPRESS schema that it would compile, evaluating derived attributes, global rules, WHERE rules etc.

I didn't use Expresso on 15926 templates because I thought I'd encounter some axioms that aren't ultimately about Part 2 -- axioms that provide a definitions of things in Part 2, for example. (See my other post today about that idea.) So I'm wondering, is this community interested in FOL reasoners because they also see more challenging validation problems coming soon, or am I just missing something about the challenge of validating Part 2 based on populations created by expansion of templates?

Best regards,
Peter

Wed Jul 18, 2012 8:54 pm

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

The expander has only very limited functionality. I use it for syntax check, a.k.a. well-formedness.
It does not check whether or not the expanded template complies with the Part 2 grammar.
You can be our hero if you write some software that does.

Regards,
Hans

Thu Jul 19, 2012 6:41 am

Joined: Sun Jan 22, 2012 9:14 pm
Posts: 189
We have only working theories about lowered and lifted RDF data. As far as I know there has not been done any practical activities using lifted data.

The working theory is:

ISO 15926 provides an upper ontology, which is generic, comprises of 201 "classes and properties" .
(the Express Entity types for relationships cannot be translated to OWL ObjectProperties hence the quotes; purchase and read ISO 15926-8 for this)
If a reasoner is configured for ISO 15926 upper ontology, it needs to be aware of this data model to infer conclusions. That will work for any RDF graph based on ISO 15926 classes and templates, now and in the future.

That would be the advantage. The disadvantage would be storing RDF in lifted form will take huge space, and interoperability will suffer from bulky payloads. Which is also still theory (what if payload would be compressed and heavily cashed?)

If RDF data would be stored in the form of template instances, a reasoner could be configured to infer conclusions by use of mapping to ISO 15926-2 entities plus template class names.

The advantage would be much lower storage requirements and smaller interoperability payloads. The disadvantage would be that templates must be standardized and associated by compatibility version numbers (conformance class). New templates would mean new versions and new mappings in the configuration.

To avoid ongoing mapping, is the reason we started the 15926. To have no need of mapping while new concepts are added to the data, is the definition of interoperability.

But that it would cause continues mapping is also theory. The base templates (link here) may prove to be as steady as the ISO 15926-2 data model and new versions may be coming sufficiently gradual or prove not to be a problem at all.

Since we don't have any empirical data on this, we continue to support both lifted and lowered RDF graphs.

But even if there is versioning in lowered RDF data, it may not be of any consequence to reasoner configuration. Example:
example wrote:
For a centrifugal pump a couple of hundred specialized templates may have been standardized in its Object Information Model (OIM). Suppose a reasoner is configured for this. Suppose the models are starting to be used for engineering of offshore platforms. The requirement is added that every object must have a "filled weight" which is used to eventually determine the weight loads and centre of gravity. This concept is added. Adding these templates to the OIM causes a new version. However the reasoner will still work. It will ignore the filled weights until configured for it, or maybe never without problems.

Thu Jul 19, 2012 7:57 am

Joined: Sun Jan 22, 2012 9:14 pm
Posts: 189
Added a solution (at the end of the first page here above) how to copy/paste in the template expander.

Mon Jul 23, 2012 9:59 am

Joined: Mon Feb 27, 2012 11:01 pm
Posts: 282
Location: Moscow, Russia
I understand that "ex is some local namespace for the example", but please, don't make examples where templates are in p7tpl: and both role identifiers and project data are from the same ex: namespace!

Sat Aug 11, 2012 10:14 pm

Joined: Sun Jan 22, 2012 9:14 pm
Posts: 189
Victor,

Are you saying that this

Quote:
ex:T12345 rdf:type p7tpl:IdentificationOfTemporalPart
ex:T12345 ex:hasTemporalWhole ex:F12345
ex:T12345 ex:hasIdentified ex:F22222
ex:T12345 ex:valIdentifier "P-101"^^xsd:string
ex:T12345 ex:valStartTime "07/11/2012"^^xsd:date

should be changed to this?

Quote:
ex:T12345 rdf:type p7tpl:IdentificationOfTemporalPart
ex:T12345 p7tpl:hasTemporalWhole ex:F12345
ex:T12345 p7tpl:hasIdentified ex:F22222
ex:T12345 p7tpl:valIdentifier "P-101"^^xsd:string
ex:T12345 p7tpl:valStartTime "07/11/2012"^^xsd:date

Mon Aug 13, 2012 2:43 pm

Joined: Mon Feb 27, 2012 11:01 pm
Posts: 282
Location: Moscow, Russia
Yes, I think it is much better. Sorry, I'm probable overreacting on namespace issues these days

Wed Aug 15, 2012 12:27 pm

Joined: Sun Jan 22, 2012 9:14 pm
Posts: 189

This download produces the all-templates.txt file, which can be used as seed for the template expander.

Also, on request from Hans, the individual spec sheets have buttons now, to browse to next and previous sheet, or link back to the specs list.

Fri Nov 16, 2012 4:24 pm
Display posts from previous:  Sort by
 Page 1 of 1 [ 9 posts ]

#### Who is online

Users browsing this forum: No registered users and 2 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ Modelling, Methods and Technology    General discussions       Archive    DEXPI Data EXchange in Process Industry    Templates    Reference Data    ISO 15926 standard, the parts       Resolved stuff    Bugs, enhancements and suggestions    Geometry Discussion Forum       Generic Geometry Issues       P&ID Geometry       3D Geometry    Part 6    Part 12 Open forum    Hello, my name is...    About the 15926    Cantina