Re: [topbraid-users] dealing with inverse properties in EVN

54 views
Skip to first unread message

Scott Henninger

unread,
May 20, 2013, 5:58:32 PM5/20/13
to topbrai...@googlegroups.com
Dmitry; This issue is pretty easily resolved in TopBraid EVN by using swa:Subjects from SWA, which is part of the standard TopBraid platform and included in EVN (see http://www.topquadrant.com/swp/ and the section named "SWP Application Components").  I'll provide some background that shows how this works.

In terms of "natural inverses", SPARQL covers this use case very well, without complexities of having to materialize inverses, etc.  Using our kennedy's example (simple, convenient, and is about relationships), you could ask for all of the parents of a person - which is equivalent to using skos:broader, but using kennedys:parent ("has parent") instead.  E.g.:

# Query #1
SELECT *
WHERE
{  ?this kennedys:parent ?parent .
}

Note I have used "?this" as a variable here.  In TopBraid ?this is the only reserved variable and is bound to the current instance.  A nice way to experiment with this is to put this in the SPARQL View in Composer and choose instances to see how ?this is bound to the instance chosen.  I have included a screen shot here to demonstrate this.

If you want to do the inverse, find the children, the look at the triple from the object direction instead of the subject direction:

# Query #2
SELECT *
WHERE
{  ?child kennedys:parent ?this .
}

Note that the same property, kennedys:parent, was used.  This can be applied to any object property.  Note that the kennedys model does materialize the parent/child inverses, but it is by no means required, as demonstrated in these examples.  SPARQL can traverse the graph wither way.

The same principle is used in EVN's user interface.  If you open /evn.topbraidlive.org/evn/evn.ui.ttl and search for the class named evnui:ConceptFormBody, you will see that the tag swa:Objects is used in most of the UI.  This gives you the SPO view as shown in Query #1.  For example, note that swa:Objects is used to display skos:broader.  But in the search view, "has narrower" also appears.  This is done by using the "inverse" of swa:Object, swa:Subject to provide the OPS view as in Query #2.

The SWA/SWP machinery takes care of the rest, including edits as well as view and search.  The SPO's and inverse OPS triples are treated exactly the same way and the user does not need to know this at all, while the back-end takes care of the details.

Customizing this for your organization is a bit of a deeper issue, as one has to be concerned about making changes that align with TopBraid EVN's future releases.  If there is general interest for this, I can write it up here or in the TQ blog.  It's really just and import and some cloning over EVN that get you there.  MOre as desired…

Hope this helps some!

-- Scott

On 5/16/2013 1:09 PM, dbv...@gmail.com wrote:
Context: EVN default UI supports custom properties in views, edit and search forms. In our problem domain many properties have natural inverse properties. For example, A hasChild B. B hasParent A. Users expect that when they look at A  they can see typed link to B, when they look at B they expect to see typed link to A. EVN default app allows users manually to add (and delete) properties so user can create A hasChild B. B hasParent A using default UI, for example.
 
Business Problem: It is inefficient to ask users to maintain manually both properties. It would be nice if EVN somehow can  "take care"  of supporting bidirectional navigation, editing and search without double maintenance.
 
I had discussions about two possible approaches to this issue
 
1) Store only one property in database and "virtualize" inverse property in EVN views, search and edit forms using EVN custom UI. 
2) Automatically add/delete second part of inverse property based on 'triggers":
if ?s ?p ?o just added and ?q is inverse Of ?p then add ?o ?q ?s 
if ?s ?p ?o just deleted and ?q is inverse Of ?p then delete ?o ?q ?s
 
Any thoughts? What is the simplest way to implement ?
 
Thank you,
 
Dmitry 
 
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live,
TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
topbrai...@googlegroups.com
To unsubscribe from this group, send email to
topbraid-user...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

thisExample.png
Reply all
Reply to author
Forward
0 new messages