tag:blogger.com,1999:blog-75070128414350120412024-03-14T04:37:12.409-07:00VOYAGES OF THE SEMANTIC ENTERPRISEIrene Polikoffhttp://www.blogger.com/profile/17834271916697741738noreply@blogger.comBlogger49125tag:blogger.com,1999:blog-7507012841435012041.post-74393809999445829822013-12-02T16:14:00.000-08:002013-12-03T08:21:11.803-08:00TopQuadrant supports PhUSE Semantic technology Initiative creating RDF Representations of CDISC Standards for Clinical Trial Information.Recently, <a href="http://www.prweb.com/releases/PhUSECDISC/SemanticTechnology/prweb11065477.htm">PhUSE and CDISC announced</a> the completion of Phase I of the FDA/PhUSE <a href="http://www.phusewiki.org/wiki/index.php?title=ST_Representing_CDISC_Foundational_Standards_In_RDF">Semantic Technology </a>Working Group Project. The PhUSE Semantic Technology Working Group aims to investigate how formal semantic standards can support the clinical and non-clinical trial data life cycle from protocol to submission. This deliverable includes a draft set of existing CDISC standards represented in RDF.<br />
<span style="color: black; font-family: "Calibri","sans-serif"; font-size: 12pt; mso-bidi-font-family: Calibri; mso-themecolor: text1;"></span><br />
In this stage of the project, the focus is on describing meta-models and models that describe and allow flexible use of the standards. This important first step was created out of an industry regulator collaboration initiated through PhUSE and supported by many CDISC volunteers who originally developed these foundational standards. <br />
<br />
The ADaM representation of this project was co-led by Phil Ashworth, semantic solution architect at TopQuadrant, with Josephine Gough and contributions from Nate Freimark, Dave Jordan, Kirsten Langendorf and Mitra Rocca. ADaM is the last standard in the food chain when it comes to presenting the results of a clinical trial for revision by the authorities. Designed to standardize the way that analysis results are stored and thus presented to authorities, ADaM provides standards for statistical analyses to reduce and eliminate any processing required by the reviewer. <br />
<br />
According to Phil, the current diverse set of standards leave the understanding of data and data relationships more open to interpretation. This initiative will create a more efficient, accurate way of representing and submitting data to the FDA and allowing data to be analyzed based on a common model where the meaning is well understood. For more details on Phil’s involvement in this project, read this wiki on <a href="http://www.phusewiki.org/wiki/index.php?title=ADaM_in_RDF">ADaM in RDF standards.</a><br />
<br />
In the next stage of this project, PhUSE and CDISC will take a closer look at demonstrating the capture of information based on these initial models and then submitting to the FDA. Additional information about this project can be found on the <a href="http://www.phusewiki.org/wiki/index.php?title=ST_Representing_CDISC_Foundational_Standards_In_RDF">PhUSE wiki</a>. <br />
<br />
Through our collaboration with PhUSE and CDISC, we hope to enable quicker decision-making for life science professionals. At TopQuadrant, we understand they need to simply and readily bring data together and view, explore and analyze it. Robert Coynehttp://www.blogger.com/profile/02357795891397805420noreply@blogger.com0tag:blogger.com,1999:blog-7507012841435012041.post-48109125131716178182013-11-22T08:11:00.000-08:002013-11-22T09:28:15.222-08:00Event Recap: Robert Coyne presented at MANAGE VARIETY—create VALUE from Big Data<p>Gartner
named semantic technologies one of the 10 most important trends in 2013 and
beyond. When it comes to Big Data, semantic technologies deliver on the variety
aspect of the <a href='http://strata.oreilly.com/2012/01/what-is-big-data.html'>three Vs</a> of Big Data (Volume, Velocity, and Variety) by enabling the right data to be processed in the correct way. During
the <a href="http://www.gartner.com/technology/symposium/barcelona/">Gartner
Symposium ITxpo in Barcelona,</a> TopQuadrant’s partner <a href="http://www.computas.com/en/">Computas</a> held a satellite event, <i>MANAGE
VARIETY—create VALUE from Big Data</i>, on November 10<sup>th</sup> to share
how customers are getting value by managing the variety of their Big Data.</p>
<p>Robert
Coyne, a co-founder of TopQuadrant, presented on the company’s vision for
semantic information ecosystems and showcased several case studies where
Semantic Web Technology is a core element in their solutions. As Robert told
the <i>MANAGE VARIETY</i> audience, semantic ecosystem solutions are evolutionary, allowing
organizations to build a <a href="http://www.gartner.com/newsroom/id/2359715">modern
information infrastructure</a> incrementally with capabilities that let them adapt
and capitalize on rapidly changing scenarios, have better access to information
resources, discover new opportunities, and inform better decision making. </p>
<p>Attendees
also learned more about TopQuadrant’s partnership with Computas, which is aimed
at delivering efficient semantic solutions in Europe. Current projects include
delivering IT services for data exchange and collaboration in the Oil and Gas
industry and an ontology management and semantic enrichment infrastructure for
the Organization for Economic Co-operation and Development (OECD), whose
Knowledge Information Management (KIM) program aims to establish an integrated
strategy and framework for managing and delivering information and knowledge.</p>
<p>TopQuadrant
is working with Computas to fulfill the
vision of the <a href="http://www.epim.no/epim/main/home">Exploration & Production
Information Management Association</a>
(EPIM) to build a
shared suite of knowledge based-applications for operators on the Norwegian
Continental Shelf using semantic technology and industry-standard domain
concepts. Computas and
TopQuadrant are engaged with EPIM to develop <a href="http://www.epim.no/environment-web/news/epim-has-signed-a-contract-with-computas-for-establishment-of-epim-environmenthub-(eeh)">EnvironmentHub</a>, a solution using TopBraid capabilities
and tools to provide a flexible semantic web standards-based platform for
environmental reporting and data integration. TopQuadrant previously developed the
<a href="http://www.reportinghub.org/erh/menu/home">ReportingHub</a> system, a standards-based
information-exchange solution that uses semantic web standards to store, query
and analyze exploration and production data.</p>
<p>Want to
learn more about these initiatives with EPIM and Computas or semantic
information ecosystems? Leave us a comment and we’ll fill you in. </p>
Bob DuCharmehttp://www.blogger.com/profile/02742075186312518829noreply@blogger.com1tag:blogger.com,1999:blog-7507012841435012041.post-45881675702312684822013-10-11T08:04:00.000-07:002013-10-11T08:48:06.296-07:00TopQuadrant’s Bob Ducharme speaking at Taxonomy Boot Camp 2013<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Bob DuCharme is speaking on the upcoming </span><a href="http://www.taxonomybootcamp.com/2013/Wednesday.aspx"><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-bidi-font-family: Arial;">"Semantic Search" panel</span></a><span style="font-family: Calibri, sans-serif; font-size: 11pt;"> during </span><a href="http://www.taxonomybootcamp.com/2013/"><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-bidi-font-family: Arial;">Taxonomy Boot
Camp</span></a><span style="font-family: Calibri, sans-serif; font-size: 11pt;"> on </span><a href="http://www.taxonomybootcamp.com/2013/program.aspx"><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-bidi-font-family: Arial;">November 6th</span></a><span style="font-family: Calibri, sans-serif; font-size: 11pt;"> in Washington D.C. Bob’s topic,
"Enhancing Searches With Taxonomies and Semantic Technology," will cover </span><span style="background: white; color: #333333; font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-bidi-font-family: Arial; mso-fareast-font-family: "Times New Roman";">how
taxonomies based on semantic technology can help with focusing and augmenting
searches, correcting terms, disambiguation and using other vocabulary metadata
sources to increase the quality of your search results.</span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"> Attendees will learn more about how </span><a href="http://www.topquadrant.com/solutions/ent_vocab_net.html"><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-bidi-font-family: Arial;">TopBraid EVN</span></a><span style="font-family: Calibri, sans-serif; font-size: 11pt;">, acting as a vocabulary server, can
improve a search engine's ability to get more accurate and relevant results,
and the role of semantic technology standards in making this happen.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Taxonomy Boot Camp is the premiere event for people who
manage vocabularies. Bob has spoken at this conference before, noting “it's
been interesting to see ideas about the value of semantic technology spread out
from thought leaders in this field to a wider audience.”<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">In addition to speaking, Bob is looking
forward to attending presentations at the conference to learn more about the
latest techniques for managing controlled vocabularies–specifically, how people
use these vocabularies to get more value out of other information assets (for
example, by aiding search engines). According to Bob, “talking with attendees
also brings me up to date about the latest challenges facing taxonomists, and
this provides great input for new TopBraid EVN features."<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Are you attending the show? If so, drop us a line and don’t
miss out on Bob and the Semantic Search panel from 3:15 p.m. to 4:00 p.m on
November 6<sup>th</sup>!<o:p></o:p></span></div>
Robert Coynehttp://www.blogger.com/profile/02357795891397805420noreply@blogger.com0tag:blogger.com,1999:blog-7507012841435012041.post-65722967855178713272013-05-29T09:53:00.000-07:002013-06-02T11:13:55.951-07:00Looking forward to Semtechbiz in San Francisco next week<div id="id123920">
<img align="right" border="0" hspace="30px" id="id123918" src="http://semanticweb.com/files/2010/12/121013_semtechbizsf_150x150.jpg" vspace="30px" />
<br />
<div id="id123922">
The Semantic Technology & Business series of conferences has held successful events in London, Berlin, New York City, and Washington D.C. in the last few years, but the <a href="http://semtechbizsf2013.semanticweb.com/" id="id123924">annual one in San Francisco</a> is the big one. We're a silver sponsor of next week's event, where we'll be looking forward to showing everyone what we've been up to and learning more about what everyone else has been doing with standards-based semantic technology.<br />
<br />
In the <a href="http://semtechbizsf2013.semanticweb.com/sponsors.cfm" id="id123932">exposition hall</a>, we'll be at booth 116, right by the exhibit hall entrance. In our booth, we'll be showing <a href="http://www.topquadrant.com/solutions/insight.html" id="id123937">TopBraid Life Sciences Insight</a>, a Logical Data Warehouse aimed at people in the Life Sciences industry, and <a href="http://www.topquadrant.com/solutions/ent_vocab_net.html" id="id123942">TopBraid Enterprise Vocabulary Net</a>, our standards-based multi-user vocabulary management solution. We'll also be happy to talk about any of our other <a href="http://www.topquadrant.com/products/TB_Suite.html" id="id123947">products</a> and projects.<br />
<br /></div>
<div id="id123930">
We'll be giving four talks at the conference:</div>
<ul id="id123956">
<li id="id123959"><div id="id123960">
TopQuadrant CTO Ralph Hodgson will present <a href="http://semtechbizsf2013.semanticweb.com/sessionPop.cfm?confid=70&proposalid=5186" id="id123962">A Case Study of a Deployed Reporting Hub for the Norwegian Oil and Gas Industry</a>, describing the <a href="http://www.reportinghub.org/erh/menu/home" id="id123784">EPIM Reporting Hub</a> that we developed with Franz Inc. (another perennial presence at the semtech conferences). In particular, Ralph will discuss the business benefits that resulted from using semantic technologies in the project. <br />
<br /></div>
</li>
<li id="id123769"><div id="id123765">
Peter Lawrence, filling in for Phil Ashworth, will talk about ways to create a standards-based federated search environment in <a href="http://semtechbizsf2013.semanticweb.com/sessionPop.cfm?confid=70&proposalid=5137" id="id123759">Enabling Data Integration and Discovery Using the Semantic Web</a>. <br />
<br /></div>
</li>
<li id="id123743"><div id="id123742">
I'll discuss approaches to <a href="http://semtechbizsf2013.semanticweb.com/sessionPop.cfm?confid=70&proposalid=5096" id="id123734">Enhancing Searches with Semantic Technology</a>—the standards, the available datasets, and the tools that can be used to improve searches.<br />
<br /></div>
</li>
<li>Peter will also give a talk titled <a href="http://semtechbizsf2013.semanticweb.com/sessionPop.cfm?confid=70&proposalid=5234">A Logical Data Warehouse in Action</a>, in which he demonstrates TopBraid Insight.</li>
</ul>
<br />
<div>
<div id="id123725">
Stop by our booth or one of our talks to say hi and to tell us about what you've been doing with semantic technologies and what you hope to do. We love the opportunity that this conference gives us to learn the latest about what people are doing with semantic web standards.</div>
</div>
</div>
Bob DuCharmehttp://www.blogger.com/profile/02742075186312518829noreply@blogger.com0tag:blogger.com,1999:blog-7507012841435012041.post-71088090115449386132013-04-05T09:28:00.001-07:002013-04-08T08:14:18.864-07:00Introducing TopBraid Life Sciences Insight—at Bio-IT World 2013<div class="separator" style="clear: both; text-align: center;">
</div>
<a href="http://www.bio-itworldexpo.com/"><img align="right" alt="TB LSI and Bio-IT logos" border="0" hspace="30px" src="http://www.topquadrant.com/resources/blog/tblsiAtBioIT2013.png" vspace="30px" width="240" /></a>
We're looking forward very much to showing <a href="http://www.topquadrant.com/solutions/insight.html">TopBraid Life Sciences Insight</a> (TopBraid LSI) at the <a href="http://www.bio-itworldexpo.com/">Bio-IT World</a> conference and expo next week in Boston.<br />
<br />
Through our research, we've found efforts in drug discovery, clinical trial research, and other data-intensive life sciences tasks are often hampered by the need for more efficient federated queries across silos, bad alignment of related data, and dependence on expensive, inflexible tools.<br />
<br />
Working with experts in the field, we've developed TopBraid LSI as a Logical or Virtual Data Warehouse: coordinated views on multiple data sources that let you query and use these data sources without actually loading them into a single data warehouse. A web-based interface lets users identify alignments between different data sources without requiring them to know the standards used to store and leverage these alignments, and then, using an approach similar to Map-Reduce, queries can be efficiently distributed across the data sources to return federated answer sets. You can learn more about how TopBraid LSI works and how it can help life sciences professionals from our new <a href="http://www.topquadrant.com/docs/whitepapers/Topbraid_Life_Sciences_Insight_Whitepaper_4-1-13.pdf">white paper</a> (PDF) on it.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
TopBraid LSI has also been selected as a finalist for Bio-IT's Best of Show award in the Informatics Tools & Data Category, so we're also looking forward to showing it to the judges. And, we're taking part in the conference's <a href="http://www.bio-itworldexpo.com/Bio-It_Expo_Content.aspx?id=123680&libID=123628">New Product Showcase</a>, which has a very interesting mix of cutting edge research and IT tools for the life sciences field. If you'll be at Bio-IT World, stop by and see us at Booth 323, where you can find out more about TopBraid Life Sciences Insight.Bob DuCharmehttp://www.blogger.com/profile/02742075186312518829noreply@blogger.com0tag:blogger.com,1999:blog-7507012841435012041.post-44365456198922461582012-07-26T18:35:00.001-07:002012-07-27T12:55:19.478-07:00Who needs SKOS-XL? Maybe no one<div class="MsoNormal">
The <a href="http://www.w3.org/TR/skos-reference/skos-xl.html" target="_blank"></a><a href="http://w3.org/TR/skos-reference/skos-xl.html" target="_blank">SKO<span id="goog_770813972"></span><span id="goog_770813973"></span>S<span id="goog_770813967"></span><span id="goog_770813968"></span>-XL</a> extension to the W3C’s <a href="http://w3.org/TR/skos-reference" target="_blank">SKOS</a> standard for vocabulary management adds flexibility in how
you track concept names, but it adds complexity and potential confusion that
are rarely, if ever, worth it. </div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
What is the appeal of SKOS-XL? Information modelers wanting to
separate concepts (so-called conceptual ideas) from terms (the names people use
for concepts) often base their thinking on the model of Semiotic Triangle <a href="http://en.wikipedia.org/wiki/Triangle_of_reference">http://en.wikipedia.org/wiki/Triangle_of_reference</a>
or Peirce’s Triangle. Sometimes also called a triangle of meaning, this philosophy
distinguishes a concept that exists in a human mind—a thought—from how it is
referred to and from a symbol that evokes it. </div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Ogden_semiotic_triangle.png/300px-Ogden_semiotic_triangle.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Ogden_semiotic_triangle.png/300px-Ogden_semiotic_triangle.png" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
A referent is understood as a word. A symbol is typically
explained as a pictorial depiction. A key aspect of this theory is its focus on human
cognition. It postulates that there can be no name or identity intrinsic to a
concept as it only exists as a thought in a human mind.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
The challenge of applying this thinking to information modeling is
that, ultimately, in information modeling we must commit everything to paper,
electronic or otherwise. Thus, every concept must have an identity and a name.
As a result, a separate model for concepts and terms where terms themselves
have identity, names, relationships and are tracked separately from concepts is
typically an over-complication that does not deliver practical value. For one
thing, even explaining to a business audience a difference between a concept
and a term is not simple. Colloquially, these words are often used interchangeably.
Once explained, distinguishing and keeping track of these on an ongoing basis,
when both “concepts” and “terms” are more often than not named using the same
words, can be mind boggling. </div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
SKOS takes a simpler and what we believe to be a more practical approach
to information modeling. It provides a way to describe concepts by giving each
one:</div>
<ul>
<li><span style="font-family: Symbol;"><span style="font: 7pt "Times New Roman";"> </span></span>A globally unique identity</li>
<li>A preferred label that is unique for a human
language (such as English or German) within a scope of a particular “concept
scheme”. It is called skos:prefLabel.</li>
<li>Any number of alternative labels called
skos:altLabel. Concept's alternative labels in a given language should not be the same as its
preferred label in this language.</li>
<li>Whatever other properties (attributes and relationships)
are deemed necessary:</li>
</ul>
<ul>
<li>SKOS supplies some standard relationships such
as skos:broader, skos:related and skos:exactMatch and a number of annotations
that are thought to be universally useful such as skos:definition and
skos:editorialNote.</li>
<li>Users of SKOS are free to add properties
specific to their domain. For example, when using SKOS to describe different
companies, a user may want to add a stock ticker field.</li>
</ul>
<div class="MsoListParagraphCxSpLast" style="margin-left: 1in; text-indent: -0.25in;">
<br /></div>
<div class="MsoNormal">
If needed, metadata about labels can be captured without giving
them identity of their own. <a href="http://topquadrant.com/solutions/ent_vocab_net.html" target="_blank">TopBraid EVN</a> is
a good example of a tool that offers this capability. Besides the language
part, such metadata is typically not just about the label itself, but about its
relationship to the concept—for example, who said that this is a preferred
label for this concept and when. All the relationships are between concepts,
not between the labels.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
The W3C has published an optional extension to SKOS called SKOS-XL
(SKOS eXtension for Labels) that accommodates those who want to give separate
identity to concepts and terms. It does not use the word “term”—presumably, because
informally terms are often understood as concepts and vice versa. Instead it
introduces a class Label explained as a “lexical entity”. While the extension
is small with only one new class and five new properties, its implications are far-reaching.
As a result, providing tool support for SKOS-XL is considerably more complex
than for SKOS proper. </div>
<div class="MsoNormal">
<br /></div>
Following the SKOS-XL model, labels are not strings as in SKOS proper, but RDF resources with their own identity. Each label can have only one literal form; this is where the actual text string (the name) goes. The literal form is not one per Label per language as with SKOS’s constraint for assigning preferred labels, but one per Label. So, to accommodate different languages, different label resources must be created. At the same time, there can be multiple Label resources with the same literal form (for example, two different Label resources with the literal form “Mouse”). Even a simple SKOS-XL vocabulary is considerably bulkier than its SKOS alternative. Since SKOS-XL format takes far more more space, storage, import/export and performance of search and query can become an issue for larger vocabularies.<br />
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Concepts are connected to Labels by relationships that indicate
preferred (skosxl:prefLabel) and
alternative Labels (skosxl:altLabel) for a
Concept. There is no cardinality restrictions on these relationships–that is, a
Concept can be linked to multiple Labels using skosxl:prefLabel<code><span style="font-family: "Calibri","sans-serif"; line-height: 115%;"> </span></code>link. Labels
can be linked to each other using skosxl:labelRelation
relationship. These links are separate from the relationships between Concepts.</div>
<div class="MsoNormal">
<br />
Direct use of SKOS properties that associate label strings with
Concepts can be tricky when using SKOS-XL. According to SKOS-XL label strings
for Concepts are derived using rules such as:</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
The property chain (<i>skosxl:prefLabel, skosxl:literalForm</i>) is a sub-property of <i>skos:prefLabel</i>. </div>
<div class="MsoNormal" style="margin-left: 0.5in;">
<br /></div>
<div class="MsoNormal">
This means that if there is a Label ex:Label1 with literal form
“love” and a Concept ex:Concept1 where ex:Concept1 connects to ex:Label1 using a
skosxl:prefLabel relationship, we can conclude that ex:Concept1 has a skos:prefLabel value of “love”. Since simultaneously keeping the integrity of
directly entered and inferred values is problematic, any tool supporting
SKOS-XL must protect the user from directly entering label strings for Concepts.
This makes it difficult to use the same tool to edit for SKOS and SKOS-XL
vocabularies, especially if users want to intermix different vocabulary
formats. </div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Furthermore, a user will see the same text label for different
entities. This will be not only because different Labels can have the same
literal forms, but also because the Concept resources “inherit” string labels
from the associated Label resources. This can easily lead to confusing results.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
There are also various integrity clashes between SKOS and SKOS-XL.
For example:</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo2; text-indent: -.25in;">
1.<span style="font: 7pt "Times New Roman";"> <i><b>
</b></i></span><i><b>Two different preferred labels in the same
language</b></i><br />
<br />
ex:Concept1skosxl:prefLabelex:Label1; skosxl:prefLabelex:Label2.<br />
ex:Label1 skosxl:literalForm "love"@en .<br />
ex:Label2 skosxl:literalForm "adoration"@en .</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
This is not “wrong” according to SKOS-XL because a Concept can be
connected to multiple Labels using the skosxl:prefLabel relationship. But, it
means that ex:Concept1has skos:prefLabel values of both "love"@en and
"adoration"@en. This is a violation of SKOS constraint S14, which
prohibits a concept from having more than one preferred label string in a given
language.</div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo2; text-indent: -.25in;">
2.<span style="font: 7pt "Times New Roman";">
</span> </div>
<div class="MsoListParagraph" style="text-indent: -0.25in;">
<i><b> Clash between preferred and alternative labels</b></i><br />
<br />
ex:Concept1skosxl:prefLabel ex:Label1; skosxl:altLabel ex:Label2<br />
ex:Label1 skosxl:literalForm "love"@en .<br />
ex:Label2 skosxl:literalForm "love"@en .</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Again, this is not “wrong” according to SKOS-XL because different
Labels can have the same literal form, but it’s a problem for SKOS because it
implies identical English language preferred and alternative label strings for
ex:Concept1.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Without a doubt, these issues play a role in the fact that while the
use and tool support for SKOS is growing, there are few if any tools for
SKOS-XL or published SKOS-XL vocabularies. An even more important factor is the
lack of compelling business value that would justify SKOS-XL complexity. Having
talked to a wide range of users working on business vocabularies, we have yet
to hear a use case that cannot be supported by SKOS alone.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Does SKOS-XL look like the only viable approach to your vocabulary
management needs? Let’s discuss it—maybe we can help you find a simpler
solution. </div>Irene Polikoffhttp://www.blogger.com/profile/17834271916697741738noreply@blogger.com0tag:blogger.com,1999:blog-7507012841435012041.post-7449314065428131712012-05-29T04:16:00.000-07:002012-05-29T04:16:21.811-07:00New white paper: Controlled vocabularies, taxonomies, and thesauruses (and ontologies)What's the difference between a controlled vocabulary, a taxonomy, a thesaurus, and an ontology? We've found people using some of these terms interchangeably, and it's difficult to find reliable official definitions for each.<br />
We've come up with some unofficial working definitions that have served us well when discussing different kinds of controlled vocabularies and their associated metadata. Our new white paper <a href="http://topquadrant.com/resources/whitepapers.html#CVTAXTHES">Controlled vocabularies, taxonomies, and thesauruses (and ontologies)</a> describes each of these and which TopQuadrant products give customers the control they need over the kinds of vocabularies and metadata that they're working with.<br />
We hope that this short white paper gives you a better idea of why people build, use, and store controlled vocabularies and the advantages that standards bring to this work.<br />
<br />
<center><img alt="Roget's Thesaurus" src="http://www.snee.com/bobdc.blog/img/tq/cvtaxthes4.jpg" vspace="20px" width="160" /></center>Bob DuCharmehttp://www.blogger.com/profile/02742075186312518829noreply@blogger.com0tag:blogger.com,1999:blog-7507012841435012041.post-39841717982692473972012-05-13T08:03:00.003-07:002012-05-13T08:11:07.906-07:00Data cathedrals versus information bazaars?<i><span style="color: #1f497d; line-height: 17px;"><span style="font-family: inherit;">Enterprises create data cathedrals with an enforced dogma to control data purity, causing much information to be outside its walls where informal information bazaars thrive. These information bazaars have suspect quality, uncertain provenance, yet are responsive to users’ needs. Metcalf's law suggests that the benefit gained from integrated information grows geometrically<sup>1</sup></span></span></i><span style="color: #1f497d; line-height: 17px;"><span style="font-family: inherit;"> </span><i><span style="font-family: inherit;">with the number of data communities that are integrated. How can we balance the dogma of the data cathedrals and the spontaneity of the information bazaar?</span></i></span><br />
<div class="MsoNormal">
<span style="color: #1f497d; line-height: 17px;"><i><br /></i></span></div>
<div class="MsoNormal">
<span style="color: #1f497d; line-height: 17px;">Enterprise's database cathedrals reflect corporate dogma. Nothing gets changed without approval from high. Change is very slow. New databases orders get integrated only after a considerably long time assuming that the new data is 100% squeaky clean. So there are a lot of databases that are entirely outside the database cathedrals' walls. Badly behaved sources of data might even be excommunicated.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: #1f497d; line-height: 17px;"><span style="font-family: inherit;">Where does the other data go? It is not as though this other data does not exist, although many would like to pretend it to be so. Instead they are all in the information bazaar. Anyone with any information can set up their own information stall, and store their own data in Excel, Access, anywhere they want. They only specialize in their own data for their own use. This data is pretty good because that is all they need for their business. They share well with others but on a barter basis. In fact the information bazaar is chaotic, but lively, always changing to users’ demands, and a fun place to be. </span><o:p></o:p></span></div>
<h2>
Why do we have the conflict between the database cathedral and the information bazaars?</h2>
<h3>
<o:p></o:p></h3>
<div class="MsoNormal" style="line-height: 12pt;">
<span style="color: #1f497d;">The data cathedral offers security, quality, and good provenance. It provides the system of record for users who then should have complete confidence in their decision making. It does this using accurate relational models capturing enterprise information. But a relational model is designed by the cathedral hierarchy based on the closed model: only pure data can be entered into the database; impure data can lead to excommunication. <o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: #1f497d;"><span style="font-family: inherit;">The information bazaar has few rules of entry. As demonstrated by the web, it allows anyone to say anything about anything (AAA). Even with this deficiency we will regularly search the web to help us with our decision making, not exploring sources that are suspect, and filtering information that we feel lacks accuracy until we end up with information to support our decision.</span><o:p></o:p></span></div>
<h2>
Can we resolve these conflicting objectives?</h2>
<h3>
<o:p></o:p></h3>
<div class="MsoNormal" style="line-height: 12pt;">
<span style="color: #1f497d;">Can we expect the cathedral hierarchy to relax its admittance criteria to let in as much of the information bazaar as possible? Somewhat, but we cannot expect miracles.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 12pt;">
<span style="color: #1f497d;">Can we expect the information bazaar to become more sober and responsible so that it can securely provide information with guaranteed quality and provenance? Somewhat, but we cannot expect an evangelical conversion?<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 12pt;">
<span style="color: #1f497d;"><span style="font-family: inherit;">Really this is not optimal, because the benefit of having data integrated grows geometrically with the number of interconnected sources, yet the database cathedral cannot grow because the information bazaar does not meet their purity dogma.</span><o:p></o:p></span></div>
<h2>
So how can these conflicting objectives be redeemed?</h2>
<h3>
<o:p></o:p></h3>
<div class="MsoNormal" style="line-height: 12pt;">
<span style="color: #1f497d;">One path to redemption is to unite the information bazaar through a common semantic model. This allows all information to be available within a universal graph (model). Of course some riff-raff will get in, but again that is an advantage for the semantic model as you can also declare rules that will verify the accuracy of the data even though it is already stored. <o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 12pt;">
<span style="color: #1f497d;">At the same time the data cathedral can continue to expand, hopefully at faster pace, by integrating those graphs that meet their criteria. <o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 12pt;">
<span style="color: #1f497d;">However we allow users to access both the data cathedral, from where they can obtain the system of record, and information bazaar. We could even report results federating form the two data-sources annotating that information from the information bazaar with its provenance and hence less certain data quality. Doing this in a standards compliant way turns existing enterprise information resources into connectable, responsive and interoperable semantic assets.<o:p></o:p></span></div>
<h2>
Harmony</h2>
<h3>
<o:p></o:p></h3>
<div class="MsoNormal" style="line-height: 12pt;">
<span style="color: #1f497d;">Using this approach we don’t need to force the data cathedral to relax its dogma, nor do we ask the information bazaar to shut down. Yet we can offer users access to 99% of the enterprise information providing users the 'Metcalf'<sup>1</sup> benefits of full integration. As semantic assets grow and connect, they enable a resilient semantic ecosystem of meaningful interactions between people, applications and data irrespective of the differences in structures, data schemas, governance and technologies. The dividing boundaries between the cathedral and the bazaar no longer need to be obstacles to information users. Semantic ecosystem seamlessly embraces and provides integrated access to data cathedrals and information bazaars alike.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 12pt;">
<br /></div>
<span style="font-family: inherit; font-size: x-small;"><sup><span style="color: #1f497d; line-height: 12px;">1</span></sup><span style="color: #1f497d; line-height: 14px;"> If I have 10 database systems running my business that are entirely disconnected, then the benefits are 10 * K, some constant. If I integrate these databases in pairs (operations + accounting, accounting + payroll, etc), then the benefits increase to 10 * K * 2. If I integrate in threes, (operations + accounting + maintenance, accounting + payroll + receiving, etc), then the benefits increase four-fold (a corollary of Metcalf's law) to 10 * K * 4. For quad-wise integration my benefits would be 10 * K * 8 and so on. Now it might not be 8 fold but the point is there is a geometric, not linear, growth in benefits as I integrate all of my information across my organization.</span></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7507012841435012041.post-56649046406346259792012-04-30T15:47:00.001-07:002012-04-30T15:50:44.683-07:00Can semantic technology melt process industry’s icebergs of information?<br />
<div class="MsoNormal">
<i><span style="color: #1f497d; font-size: 11pt; line-height: 110%;">Icebergs
of information loiter throughout process manufacturing IT waiting to sink any
information integration project. The impact of semantic technologies is being
felt in medicine, life sciences, intelligence, and elsewhere but can it solve
this problem in process manufacturing? The ability to federate information from
multiple data-sources into a schema-less structure, and then deliver that
federated information in any format and in accordance with any standard schema
uniquely positions semantic technology. Is this a sweet spot for semantic
technologies?<o:p></o:p></span></i></div>
<div class="MsoNormal" style="line-height: 21.6pt;">
<a href="file:///C:/Users/PeterL/Desktop/Inova8/Blog/Blog.docx"><span style="color: windowtext; text-decoration: none;"><span style="color: #454545; display: none; font-family: Arial, sans-serif; font-size: 9pt;"><v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f">
<v:stroke joinstyle="miter">
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0">
<v:f eqn="sum @0 1 0">
<v:f eqn="sum 0 0 @1">
<v:f eqn="prod @2 1 2">
<v:f eqn="prod @3 21600 pixelWidth">
<v:f eqn="prod @3 21600 pixelHeight">
<v:f eqn="sum @0 0 1">
<v:f eqn="prod @6 1 2">
<v:f eqn="prod @7 21600 pixelWidth">
<v:f eqn="sum @8 21600 0">
<v:f eqn="prod @7 21600 pixelHeight">
<v:f eqn="sum @10 21600 0">
</v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas>
<v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f">
<o:lock aspectratio="t" v:ext="edit">
</o:lock></v:path></v:stroke></v:shapetype><v:shape alt="Hide All" href="" id="Picture_x0020_3" o:button="t" o:spid="_x0000_i1036" style="height: 6.75pt; mso-wrap-style: square; visibility: visible; width: 6.75pt;" type="#_x0000_t75">
<v:fill o:detectmouseclick="t">
<v:imagedata o:title="Hide All" src="file:///C:\Users\PeterL\AppData\Local\Temp\msohtmlclip1\01\clip_image001.gif">
</v:imagedata></v:fill></v:shape></span></span><span style="color: #454545; display: none; font-family: Arial, sans-serif; font-size: 9pt; text-decoration: none;">Hide All</span></a><span style="color: #454545; display: none; font-family: Arial, sans-serif; font-size: 9pt;"><o:p></o:p></span></div>
<h3>
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc323387089"></a><a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="BMbacktotop"></a><a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc272239285"></a>Process Manufacturing Application Focus over
the Years</h3>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">Over the years we have been solving problems within process
manufacturing IT only to uncover more problems. Once the problem was that of
measurement data in silos which was solved by the introduction of real-time data
historians. However that created the problems of data visibility, solved by the
introduction of graphical user interfaces. This introduced data overload which
was partially solved by the introduction of analytical tools to digest the
information and produce diagnostics. Unfortunately these tools were difficult
to deploy across all assets within an organization, so we have been trying to
solve that problem with information models. The current problem is how to
convert the diagnostics into actionable knowledge with the use of work-flow
engines and ensuring the sustainability of applications as solutions increases
in complexity.<o:p></o:p></span></div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; margin-left: 0.1in; width: 678px;">
<tbody>
<tr style="height: 15.65pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;">
<td colspan="7" style="background: #FE8637; border-bottom: solid white 3.0pt; border: solid white 1.0pt; height: 15.65pt; padding: .05in .1in .05in .1in; width: 508.5pt;" valign="top" width="678"><div align="center" class="MsoNormal" style="text-align: center;">
<b><span style="font-size: 14pt; line-height: 110%;">Process Manufacturing Application Problems and
Solutions over the Years</span><o:p></o:p></b></div>
</td>
</tr>
<tr style="height: 21.5pt; mso-yfti-irow: 1;">
<td style="background: #FE8637; border-bottom: solid white 3.0pt; border-left: solid white 1.0pt; border-right: solid white 1.0pt; border-top: none; height: 21.5pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 63.95pt;" valign="top" width="85"></td>
<td style="background: #FE8637; border-bottom: solid white 3.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 21.5pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 80.05pt;" valign="top" width="107"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-size: 10pt; line-height: 110%;">1985-</span></b><span style="font-size: 10pt; line-height: 110%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-size: 10pt; line-height: 110%;">1995 </span></b><span style="font-size: 10pt; line-height: 110%;"><o:p></o:p></span></div>
</td>
<td style="background: #FE8637; border-bottom: solid white 3.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 21.5pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 1.0in;" valign="top" width="96"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-size: 10pt; line-height: 110%;">1990-</span></b><span style="font-size: 10pt; line-height: 110%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-size: 10pt; line-height: 110%;">2000 </span></b><span style="font-size: 10pt; line-height: 110%;"><o:p></o:p></span></div>
</td>
<td style="background: #FE8637; border-bottom: solid white 3.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 21.5pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-size: 10pt; line-height: 110%;">1995-</span></b><span style="font-size: 10pt; line-height: 110%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-size: 10pt; line-height: 110%;">2005 </span></b><span style="font-size: 10pt; line-height: 110%;"><o:p></o:p></span></div>
</td>
<td style="background: #FE8637; border-bottom: solid white 3.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 21.5pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-size: 10pt; line-height: 110%;">2000-</span></b><span style="font-size: 10pt; line-height: 110%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-size: 10pt; line-height: 110%;">2010 </span></b><span style="font-size: 10pt; line-height: 110%;"><o:p></o:p></span></div>
</td>
<td style="background: #FE8637; border-bottom: solid white 3.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 21.5pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-size: 10pt; line-height: 110%;">2005-</span></b><span style="font-size: 10pt; line-height: 110%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-size: 10pt; line-height: 110%;">2015 </span></b><span style="font-size: 10pt; line-height: 110%;"><o:p></o:p></span></div>
</td>
<td style="background: #FE8637; border-bottom: solid white 3.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 21.5pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 63.0pt;" valign="top" width="84"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-size: 10pt; line-height: 110%;">2010- </span></b><span style="font-size: 10pt; line-height: 110%;"><o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 32.75pt; mso-yfti-irow: 2;">
<td style="background: #FFEDE8; border-top: none; border: solid white 1.0pt; height: 32.75pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 63.95pt;" valign="top" width="85"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-size: 9pt; line-height: 110%;">Problem </span></b><span style="font-size: 9pt; line-height: 110%;"><o:p></o:p></span></div>
</td>
<td style="background: #FFEDE8; border-bottom: solid white 1.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 32.75pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 80.05pt;" valign="top" width="107"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-size: 9pt; line-height: 110%;">Measurement
data in silos <o:p></o:p></span></div>
</td>
<td style="background: #FFEDE8; border-bottom: solid white 1.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 32.75pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 1.0in;" valign="top" width="96"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-size: 9pt; line-height: 110%;">Data
access and visualization <o:p></o:p></span></div>
</td>
<td style="background: #FFEDE8; border-bottom: solid white 1.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 32.75pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-size: 9pt; line-height: 110%;">Analysis
and business intelligence <o:p></o:p></span></div>
</td>
<td style="background: #FFEDE8; border-bottom: solid white 1.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 32.75pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-size: 9pt; line-height: 110%;">Contextualized
information <o:p></o:p></span></div>
</td>
<td style="background: #FFEDE8; border-bottom: solid white 1.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 32.75pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-size: 9pt; line-height: 110%;">Consistent
actioning <o:p></o:p></span></div>
</td>
<td style="background: #FFEDE8; border-bottom: solid white 1.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 32.75pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 63.0pt;" valign="top" width="84"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-size: 9pt; line-height: 110%;">Sustainability
<o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 64.25pt; mso-yfti-irow: 3;">
<td style="background: #FFEDE8; border-top: none; border: solid white 1.0pt; height: 64.25pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 63.95pt;" valign="top" width="85"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-size: 9pt; line-height: 110%;">Industry</span></b><span style="font-size: 9pt; line-height: 110%;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-size: 9pt; line-height: 110%;">Response </span></b><span style="font-size: 9pt; line-height: 110%;"><o:p></o:p></span></div>
</td>
<td style="background: #FFEDE8; border-bottom: solid white 1.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 64.25pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 80.05pt;" valign="top" width="107"><div class="MsoNormal">
<span style="font-size: 9pt; line-height: 110%;">Real-time databases collecting measurements<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 9pt; line-height: 110%;">(proprietary) <o:p></o:p></span></div>
</td>
<td style="background: #FFEDE8; border-bottom: solid white 1.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 64.25pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 1.0in;" valign="top" width="96"><div class="MsoNormal">
<span style="font-size: 9pt; line-height: 110%;">Graphical user interfaces, trending and reporting tools<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 9pt; line-height: 110%;">(proprietary)<o:p></o:p></span></div>
</td>
<td style="background: #FFEDE8; border-bottom: solid white 1.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 64.25pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal">
<span style="font-size: 9pt; line-height: 110%;">Analytical tools to digest data into information and
diagnostics <o:p></o:p></span></div>
</td>
<td style="background: #FFEDE8; border-bottom: solid white 1.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 64.25pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal">
<span style="font-size: 9pt; line-height: 110%;">Plant data models (ProdML, ISA-95, ISO15926, IEC
61970/61968, Proprietary) <o:p></o:p></span></div>
</td>
<td style="background: #FFEDE8; border-bottom: solid white 1.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 64.25pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal">
<span style="font-size: 9pt; line-height: 110%;">ISO-9001 <o:p></o:p></span></div>
</td>
<td style="background: #FFEDE8; border-bottom: solid white 1.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 64.25pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 63.0pt;" valign="top" width="84"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-size: 9pt; line-height: 110%;">Outsourcing<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-size: 9pt; line-height: 110%;">Standards<o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 42.65pt; mso-yfti-irow: 4; mso-yfti-lastrow: yes;">
<td style="background: #FFEDE8; border-top: none; border: solid white 1.0pt; height: 42.65pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 63.95pt;" valign="top" width="85"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-size: 9pt; line-height: 110%;">Consequence
<o:p></o:p></span></b></div>
</td>
<td style="background: #FFEDE8; border-bottom: solid white 1.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 42.65pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 80.05pt;" valign="top" width="107"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-size: 9pt; line-height: 110%;">Data but no user access <o:p></o:p></span></div>
</td>
<td style="background: #FFEDE8; border-bottom: solid white 1.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 42.65pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 1.0in;" valign="top" width="96"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-size: 9pt; line-height: 110%;">Data overload <o:p></o:p></span></div>
</td>
<td style="background: #FFEDE8; border-bottom: solid white 1.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 42.65pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-size: 9pt; line-height: 110%;">Deployability of analysis to all assets <o:p></o:p></span></div>
</td>
<td style="background: #FFEDE8; border-bottom: solid white 1.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 42.65pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-size: 9pt; line-height: 110%;">Interpretation limited to experts <o:p></o:p></span></div>
</td>
<td style="background: #FFEDE8; border-bottom: solid white 1.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 42.65pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-size: 9pt; line-height: 110%;">Complexity, much more than RTDB, limiting sustainability <o:p></o:p></span></div>
</td>
<td style="background: #FFEDE8; border-bottom: solid white 1.0pt; border-left: none; border-right: solid white 1.0pt; border-top: none; height: 42.65pt; mso-border-left-alt: solid white 1.0pt; mso-border-top-alt: solid white 1.0pt; padding: .05in .1in .05in .1in; width: 63.0pt;" valign="top" width="84"><div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-size: 9pt; line-height: 110%;">Improved ongoing application benefits<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">However it is not only the increased technological complexity that is causing
problems. Business decisions now cross many more business boundaries. When
measurement data was trapped in silos we were content with unit-wide or
plant-wide data historians. Now a well performance problem might involve a
maintenance engineer located in Houston accessing a </span><a href="http://www.mimosa.org/"><span style="font-size: 11pt; line-height: 110%;">Mimosa</span></a><span class="MsoFootnoteReference"><span style="color: #1f497d; font-size: 11pt; line-height: 110%;"><span class="MsoFootnoteReference"><span style="font-family: 'Tw Cen MT', sans-serif; font-size: 11pt; line-height: 110%;">[1]</span></span></span></span><span style="color: #1f497d; font-size: 11pt; line-height: 110%;">-based
maintenance management system, an operations engineer located in Aberdeen
accessing an </span><a href="http://www.opcfoundation.org/Default.aspx/01_about/UA.asp?MID=AboutOPC"><span style="font-size: 11pt; line-height: 110%;">OPC-UA</span></a><span class="MsoFootnoteReference"><span style="color: #1f497d; font-size: 11pt; line-height: 110%;"><span class="MsoFootnoteReference"><span style="font-family: 'Tw Cen MT', sans-serif; font-size: 11pt; line-height: 110%;">[2]</span></span></span></span><span style="color: #1f497d; font-size: 11pt; line-height: 110%;">-based
data historian, a production engineer located in London accessing a custom
system driven by </span><a href="http://www.energistics.org/witsml-standard"><span style="font-size: 11pt; line-height: 110%;">WITSML</span></a><span class="MsoFootnoteReference"><span style="color: #1f497d; font-size: 11pt; line-height: 110%;"><span class="MsoFootnoteReference"><span style="font-family: 'Tw Cen MT', sans-serif; font-size: 11pt; line-height: 110%;">[3]</span></span></span></span><span style="color: #1f497d; font-size: 11pt; line-height: 110%;">-based
feeds, and a facilities engineer using an </span><a href="https://www.posccaesar.org/wiki/ISO15926"><span style="font-size: 11pt; line-height: 110%;">ISO-15926</span></a><span class="MsoFootnoteReference"><span style="color: #1f497d; font-size: 11pt; line-height: 110%;"><span class="MsoFootnoteReference"><span style="font-family: 'Tw Cen MT', sans-serif; font-size: 11pt; line-height: 110%;">[4]</span></span></span></span><span style="color: #1f497d; font-size: 11pt; line-height: 110%;">
facilities management model. Not only are the participants in different
locations and business units, but they also rely on different systems using
different models to support their decision making. However they all should be
talking about the same well, measured by the same instruments, producing the
same flows, and processed by the same equipment. <o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">The problem is that these operational support systems are not simply data
silos whose homogeneous data we need to merge into one to answer our questions.
In fact these operational support systems are icebergs of information. Above
the surface they publish a public perspective focused on the core operational function
of the application. However this data needs context, so below the surface is much
of the same information that is contained in other systems. This information
provides the context to the operational data so that the operational system can
perform its required functions. For example the historian needs to know
something about the instruments that are the source of its measurements;
maintenance management systems need to know not only about the equipment to be
maintained but the location of that equipment, physically and organizationally.<o:p></o:p></span></div>
<div align="center" class="MsoNormal" style="page-break-after: avoid; text-align: center;">
<v:shape alt="Icebergs of Information.png" id="Picture_x0020_10" o:spid="_x0000_i1035" style="height: 264pt; mso-wrap-style: square; visibility: visible; width: 7in;" type="#_x0000_t75">
<v:imagedata o:title="Icebergs of Information" src="file:///C:\Users\PeterL\AppData\Local\Temp\msohtmlclip1\01\clip_image002.png">
</v:imagedata></v:shape></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKOAruIlyQgur2LFY8kBYGia0YXOhDx_k-WPdCix087xfWXhscW4adv8abUnF2yAblr_dgICjj-kupik7Km0fHobL952Ubrdz0nlgMgXBt7WMFvUI_j_WDSJrkHgSZSpF2j4-80OAhaPEP/s1600/Icebergs+of+Information.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="206" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKOAruIlyQgur2LFY8kBYGia0YXOhDx_k-WPdCix087xfWXhscW4adv8abUnF2yAblr_dgICjj-kupik7Km0fHobL952Ubrdz0nlgMgXBt7WMFvUI_j_WDSJrkHgSZSpF2j4-80OAhaPEP/s400/Icebergs+of+Information.png" width="400" /></a></div>
<div align="center" class="MsoCaption" style="text-align: center;">
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc322162151"><br /></a></div>
<div align="center" class="MsoCaption" style="text-align: center;">
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc322162151">Figure </a>1: Icebergs of Information</div>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">Icebergs of information are not limited to the operational data stores
deployed in organizations. An essential practice in these days of
interoperability requirements is the adoption of model standards. However even
these exhibit the same problems as shown by the diagram below. This diagram
maps the available standards to its focus within the hydrocarbon supply chain.<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhge3mmkbGvLevAyg20R_p4eDPXDd2lcFEAfD8vx2kjx4JwvRmljORXEn2F1UsG_Un5lDsJBt-5cmgK__q0rCB3IKiLXvO2JpgaRDpurXKxi2C-Tr9TTms5zI5zMuN_KJ-1i5HPVqooHXgb/s1600/Overlapping+model+standards.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="141" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhge3mmkbGvLevAyg20R_p4eDPXDd2lcFEAfD8vx2kjx4JwvRmljORXEn2F1UsG_Un5lDsJBt-5cmgK__q0rCB3IKiLXvO2JpgaRDpurXKxi2C-Tr9TTms5zI5zMuN_KJ-1i5HPVqooHXgb/s400/Overlapping+model+standards.png" width="400" /></a></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;"><br /></span></div>
<div align="center" class="MsoNormal" style="page-break-after: avoid; text-align: center;">
<v:shape alt="Overlapping model standards.png" id="Picture_x0020_41" o:spid="_x0000_i1034" style="height: 181.5pt; mso-wrap-style: square; visibility: visible; width: 7in;" type="#_x0000_t75">
<v:imagedata o:title="Overlapping model standards" src="file:///C:\Users\PeterL\AppData\Local\Temp\msohtmlclip1\01\clip_image003.png">
</v:imagedata></v:shape></div>
<div align="center" class="MsoCaption" style="text-align: center;">
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc322162152">Figure 2</a>: Multiple Overlapping Model Standards</div>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">Increasing regulatory and competitive demands on the business are
forcing decision making to be more timely, and to be more integrated across the
traditional business boundaries. However these icebergs are getting in the way
of effective decision making.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">One way to make any or all of this information available to consumers is
to create the bigger iceberg. ‘Simply’ create the relational database schema
that covers every past, current, and future business need, and build adapters
to populate this database from the operational data stores. Unfortunately this
mega-store can only get more complex as it has to keep up with an expanding
scope of information required to support the decision making processes.<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirV2dmrPuXVuyMgPvlpmag-cq5K8nFLBawHtQ-ZUmYyxHwPRjV4QX1SWve0t6PbRGybFKNPE43k6KVBbE-O_7OgJ2TrTVXIp7bGx021gxZf9oj8Ftd5wD2DbU07cBxpq0NRUhuuGWaHr1j/s1600/Bigger+iceberg+of+information.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="211" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirV2dmrPuXVuyMgPvlpmag-cq5K8nFLBawHtQ-ZUmYyxHwPRjV4QX1SWve0t6PbRGybFKNPE43k6KVBbE-O_7OgJ2TrTVXIp7bGx021gxZf9oj8Ftd5wD2DbU07cBxpq0NRUhuuGWaHr1j/s400/Bigger+iceberg+of+information.png" width="400" /></a></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;"><br /></span></div>
<div align="center" class="MsoNormal" style="page-break-after: avoid; text-align: center;">
<v:shape alt="Bigger iceberg of information.png" id="Picture_x0020_57" o:spid="_x0000_i1033" style="height: 270pt; mso-wrap-style: square; visibility: visible; width: 7in;" type="#_x0000_t75">
<v:imagedata o:title="Bigger iceberg of information" src="file:///C:\Users\PeterL\AppData\Local\Temp\msohtmlclip1\01\clip_image004.png">
</v:imagedata></v:shape></div>
<div align="center" class="MsoCaption" style="text-align: center;">
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc322162153">Figure </a>3: Integration using the Bigger Iceberg</div>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">Alternatively we can keep building data-marts every time someone has a
different business query. However these
do not provide the timeliness required to support operational decision making.<o:p></o:p></span></div>
<h3>
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc323387090">The Need for a Babel-Fish</a> </h3>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">We cannot meet the needs of the business, and solve their decision
making needs by having one mega-store because it will never keep up with the
changing business requirements. Instead we need a babel-fish (with thanks to
the Hitchhikers Guide to the Galaxy). <o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">This babel-fish can consume all of the different operational data in
different standards, and translate them into any standard that the
end-consumer wants. Thus the babel-fish will need to know that OPC UA's concept
'hasInstrument' has the same meaning as Mimosa's concept of
'Instrumented'. Similarly 10FIC107 from an OPCUA provider is the same as
10-FIC-1-7 from Mimosa.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 47.25pt; text-indent: -0.25in;">
<span style="color: #1f497d; font-size: 11pt;">1.<span style="font-size: 7pt;"> </span></span><span style="color: #1f497d; font-size: 11pt;">Information providers
(operational data stores) within the business will want to provide information
according to their capabilities, but preferably using the standards appropriate
for their application. For example measurements should be OPC
UA, maintenance should use Mimosa<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 47.25pt; text-indent: -0.25in;">
<span style="color: #1f497d; font-size: 11pt;">2.<span style="font-size: 7pt;"> </span></span><span style="color: #1f497d; font-size: 11pt;">Information consumers will
want to consume information in the form of one or more standards appropriate
for their application.<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfQpzvBF3meE_t4PKZ-Px9Q0hM6HtLJlJQMqLC6FtCRCoNOS0kjUTHAKw8uRm-goxY1nNX9987FBH0c7IBSdQSPdXlJw9DIVLrr94kITG9BIGGiSxmtcBI2Flrcl3uCnq7T9zJnBbnjy2U/s1600/Babel+fish.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="277" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfQpzvBF3meE_t4PKZ-Px9Q0hM6HtLJlJQMqLC6FtCRCoNOS0kjUTHAKw8uRm-goxY1nNX9987FBH0c7IBSdQSPdXlJw9DIVLrr94kITG9BIGGiSxmtcBI2Flrcl3uCnq7T9zJnBbnjy2U/s400/Babel+fish.png" width="400" /></a></div>
<div class="MsoNormal" style="margin-left: 47.25pt; text-indent: -0.25in;">
<span style="color: #1f497d; font-size: 11pt;"><br /></span></div>
<div align="center" class="MsoNormal" style="page-break-after: avoid; text-align: center;">
<v:shape alt="Babel fish.png" id="Picture_x0020_133" o:spid="_x0000_i1032" style="height: 270.75pt; mso-wrap-style: square; visibility: visible; width: 387pt;" type="#_x0000_t75">
<v:imagedata o:title="Babel fish" src="file:///C:\Users\PeterL\AppData\Local\Temp\msohtmlclip1\01\clip_image005.png">
</v:imagedata></v:shape></div>
<div align="center" class="MsoCaption" style="text-align: center;">
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc322162154">Figure </a>4: Integration babel-fish</div>
<h3>
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc323387091">The Semantic/RDF model comes to the rescue</a></h3>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">First of all a definition: a semantic model means organizing all data
and knowledge as RDF triples {subject, property, object}. Thus {:Peter, :hasAge,
21^^:years}, and {:Pump101, :manufacturedBy, :Rotek} are examples of RDF
triples. RDF triples can be persisted in a variety of ways: SQL table, custom
organizations, NoSQL, XML files and many more. If we were designing relational
database to hold these RDF triples we would only have one ‘table’ so it may
appear that we have no schema, in the relational database design-sense when we
have key relationships to enforce integrity, and unique indices to enforce
uniqueness. However we can add other statements about the data such as {:Pump101,
:type, :ReciprocatingPump} and {:ReciprocatingPump, :subClassOf, :Pump}<sup><sup><span style="color: #1f497d; font-family: 'Tw Cen MT', sans-serif; font-size: 11pt; line-height: 110%;">[5]</span></sup></sup>.
Used in combination with a reasoner we can infer consequences from these
asserted facts, such as :Pump101 is a type of :Pump, and Peter is not a :Pump,
despite rumors to the contrary. These triples can be visualized as the links in
a graph with the subject and object being the nodes of the graph, and the
property the name of the edge linking these nodes:<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9A0jQ8Q34hjKRGogbMo2OX0GMHoZIDhF7NycSia4O_Fac2_8NzLDQmUKyw0Yk-OJm7CHeFDO4jUwZHqSkxovXz06mXSMB52iM-LaqVNLoylraLejAUNZ4W11EDa_IwLkzf1h8qsPK2Vp7/s1600/RDF+graph.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9A0jQ8Q34hjKRGogbMo2OX0GMHoZIDhF7NycSia4O_Fac2_8NzLDQmUKyw0Yk-OJm7CHeFDO4jUwZHqSkxovXz06mXSMB52iM-LaqVNLoylraLejAUNZ4W11EDa_IwLkzf1h8qsPK2Vp7/s400/RDF+graph.png" width="400" /></a></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;"><br /></span></div>
<div align="center" class="MsoNormal" style="page-break-after: avoid; text-align: center;">
<v:shape alt="RDF graph.png" id="Picture_x0020_150" o:spid="_x0000_i1031" style="height: 172.5pt; mso-wrap-style: square; visibility: visible; width: 358.5pt;" type="#_x0000_t75">
<v:imagedata o:title="RDF graph" src="file:///C:\Users\PeterL\AppData\Local\Temp\msohtmlclip1\01\clip_image006.png">
</v:imagedata></v:shape></div>
<div align="center" class="MsoCaption" style="text-align: center;">
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc322162155">Figure </a>5: RDF Triples as a graph<span style="color: #1f497d; font-size: 11pt; line-height: 110%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">Over the years, new modeling metaphors have been introduced to solve
perceived or actual problems with their predecessors. For example the
Relational Model had perceived difficulties associated with reporting, model
complexity, flexibility, and data distribution. A semantic model helps solve
these problems.<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipemgtD7h02EFyI-kZukmXGz3GAuGMzSAICf5UJwwc1O1AUjfRz26NJlz7XfA5n3Dmw8H7PdmSn-HCbS9mxMVEyNp3JBq2Gy_zRnIL-z1qL7aESUN8KyM5TitXTRNNGbxL62FG3a4b68ir/s1600/RDB+OO+OLAP+Semantic.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="231" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipemgtD7h02EFyI-kZukmXGz3GAuGMzSAICf5UJwwc1O1AUjfRz26NJlz7XfA5n3Dmw8H7PdmSn-HCbS9mxMVEyNp3JBq2Gy_zRnIL-z1qL7aESUN8KyM5TitXTRNNGbxL62FG3a4b68ir/s400/RDB+OO+OLAP+Semantic.png" width="400" /></a></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;"><br /></span></div>
<h3 align="center" style="page-break-after: avoid; text-align: center;">
<v:shape alt="RDB OO OLAP Semantic.png" id="Picture_x0020_148" o:spid="_x0000_i1030" style="height: 294.75pt; mso-wrap-style: square; visibility: visible; width: 7in;" type="#_x0000_t75">
<v:imagedata o:title="RDB OO OLAP Semantic" src="file:///C:\Users\PeterL\AppData\Local\Temp\msohtmlclip1\01\clip_image007.png">
</v:imagedata></v:shape></h3>
<div align="center" class="MsoCaption" style="text-align: center;">
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc322162156">Figure </a>6: Evolution of Model Metaphors</div>
<div align="center" class="MsoCaption" style="text-align: center;">
<br /></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l1 level1 lfo4; text-indent: -.25in;">
<span style="color: #1f497d; font-family: Symbol; font-size: 11pt; line-height: 110%;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><span style="color: #1f497d; font-size: 11pt; line-height: 110%;">In response to the perceived <b>reporting issues</b>, OLAP techniques were introduced
along with the data warehouse. This greatly eased the problem of
user-reporting, and data mining. However it did introduce the problem of data
duplication.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 1.0in; mso-add-space: auto; mso-list: l1 level2 lfo4; text-indent: -.25in;">
<span style="color: #1f497d; font-family: 'Courier New'; font-size: 11pt; line-height: 110%;">o<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span style="color: #1f497d; font-size: 11pt; line-height: 110%;">A
semantic model can query against a federated model in which information is
distributed throughout the original data sources. <o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l2 level1 lfo1; text-indent: -.25in;">
<span style="color: #1f497d; font-family: Symbol; font-size: 11pt; line-height: 110%;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><span style="color: #1f497d; font-size: 11pt; line-height: 110%;">In response to the perceived <b>complexity issues</b>, various forms of
object-orientated modeling were introduced. There is no doubt that it is easier
to think of one’s problem in terms of an object model rather than a complex
relational or ER model, especially when there are a large number of entities
and relations. <o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 1.0in; mso-add-space: auto; mso-list: l2 level2 lfo1; text-indent: -.25in;">
<span style="color: #1f497d; font-family: 'Courier New'; font-size: 11pt; line-height: 110%;">o<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span style="color: #1f497d; font-size: 11pt; line-height: 110%;">The
semantic model is built around the very simple concept of statements of facts
such as {:Peter, :hasAge, 21^^:years}, and {:Pump101, :manufacturedBy, :Rotek}
combined with statements that describe the model such as {:Pump101, :type, :ReciprocatingPump}
and {:ReciprocatingPump, :subClassOf, :Pump}.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l2 level1 lfo1; text-indent: -.25in;">
<span style="color: #1f497d; font-family: Symbol; font-size: 11pt; line-height: 110%;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><span style="color: #1f497d; font-size: 11pt; line-height: 110%;">The model <b>flexibility</b> problem occurs when, after the model has been designed,
the business needs the model to change. In response to this flexibility issue,
the choice is to make the original model anticipate all potential uses but then
risk complexity, or use an object-relational approach in which it is possible
to add new attributes without changing the underlying storage schema.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 1.0in; mso-add-space: auto; mso-list: l2 level2 lfo1; text-indent: -.25in;">
<span style="color: #1f497d; font-family: 'Courier New'; font-size: 11pt; line-height: 110%;">o<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span style="color: #1f497d; font-size: 11pt; line-height: 110%;">In
semantic models these relationships are expressed in triples, using RDFS, SKOS,
OWL, etc. Thus RDF is also used as the physical model (in RDF stores, at
least).<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l2 level1 lfo1; text-indent: -.25in;">
<span style="color: #1f497d; font-family: Symbol; font-size: 11pt; line-height: 110%;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><span style="color: #1f497d; font-size: 11pt; line-height: 110%;">There have been various responses to <b>data distribution</b>. <o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 1.0in; mso-add-space: auto; mso-list: l2 level2 lfo1; text-indent: -.25in;">
<span style="color: #1f497d; font-family: 'Courier New'; font-size: 11pt; line-height: 110%;">o<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span style="color: #1f497d; font-size: 11pt; line-height: 110%;">In the
relational world there is not much choice other than to replicate the data from
heterogeneous data stores using Extract-Transform-Load (ETL) techniques. In the
case of homogenous but distributed databases distributed queries are possible,
although it does require intimate knowledge of all the schemas in all of the
distributed databases. <o:p></o:p></span></div>
<div class="MsoListParagraphCxSpLast" style="margin-left: 1.0in; mso-add-space: auto; mso-list: l2 level2 lfo1; text-indent: -.25in;">
<span style="color: #1f497d; font-family: 'Courier New'; font-size: 11pt; line-height: 110%;">o<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span style="color: #1f497d; font-size: 11pt; line-height: 110%;">In the
object-orientated world we are in a worse situation: it is very difficult to
manage a distributed object in which different objects are distributed or
attributes are distributed.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">The good news is that a semantic approach is the ideal (or even the only)
approach that can solve the information integration problem as follows:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 47.25pt; text-indent: -0.25in;">
<span style="color: #1f497d; font-size: 11pt;">1.<span style="font-size: 7pt;"> </span></span><b><span style="color: #1f497d; font-size: 11pt;">Convert to RDF normal form</span></b><span style="color: #1f497d; font-size: 11pt;">: Convert all source data into RDF. </span><span style="color: #1f497d; font-size: 11pt;">The data
can be left at source and fetched on demand (federated) or moved into temporary
RDF storage</span><span style="color: #1f497d; font-size: 11pt;"> <o:p></o:p></span></div>
<ol start="1" type="1">
<ul type="disc">
<li class="MsoNormal" style="color: #1f497d;"><span style="font-size: 11pt;">There are
already standard ways of doing this for any spreadsheet, relational
database, XML schema, and more. For example, TopBraid Suite</span><span style="font-size: 11pt;"> (</span><span style="color: windowtext;"><a href="http://www.topquadrant.com/products/TB_Suite.html"><span style="font-size: 11pt;">http://www.topquadrant.com/products/TB_Suite.html</span></a></span><span style="font-size: 11pt;">) provides
converters and adaptors for all common data sources. </span><span style="font-size: 11pt;">It
is relatively easy to create more mappings such as OPCUA. The
dynamic adapters act as SPARQLEndpoints<a href="file:///C:/Users/PeterL/Desktop/Inova8/Blog/Blog.docx#_ftn6" name="_ftnref6" title=""><span class="MsoFootnoteReference"><span class="MsoFootnoteReference"><span style="color: #1f497d; font-family: 'Tw Cen MT', sans-serif; font-size: 11pt; line-height: 110%;">[6]</span></span></span></a>.<o:p></o:p></span></li>
</ul>
</ol>
<div class="MsoNormal" style="margin-left: 47.25pt; text-indent: -0.25in;">
<span style="color: #1f497d; font-size: 11pt;">2.<span style="font-size: 7pt;"> </span></span><b><span style="color: #1f497d; font-size: 11pt;">Federated data model</span></b><span style="color: #1f497d; font-size: 11pt;">: Create 'rules' that map one vocabulary to another. <o:p></o:p></span></div>
<ol start="2" type="1">
<ul type="disc">
<li class="MsoNormal" style="color: #1f497d;"><span style="font-size: 11pt;">The language of
these rules would be RDFS, SKOS and OWL. For example you
can declare {OPCUA:hasInstrument, owl:sameAs,
Mimosa:Instrumented}. Note that these are simply additional statements expressed
in RDF which are then used by a reasoner to infer the consequences such
as :FI101 is actually the same as :10FIC101.<o:p></o:p></span></li>
<li class="MsoNormal" style="color: #1f497d;"><span style="font-size: 11pt;">More sophisticated
rules can also be created using directly RDF and SPARQL. For some
examples, see SPIN or SPARQL Rules at </span><span style="color: windowtext;"><a href="http://spinrdf.org/"><span style="font-size: 11pt;">http://spinrdf.org/</span></a></span><span style="font-size: 11pt;"> and </span><span style="color: windowtext;"><a href="http://www.w3.org/Submission/2011/SUBM-spin-overview-20110222/"><span style="font-size: 11pt;">http://www.w3.org/Submission/2011/SUBM-spin-overview-20110222/</span></a></span><span style="font-size: 11pt;"> <o:p></o:p></span></li>
</ul>
</ol>
<div class="MsoNormal" style="margin-left: 47.25pt; text-indent: -0.25in;">
<span style="color: #1f497d; font-size: 11pt;">3.<span style="font-size: 7pt;"> </span></span><b><span style="color: #1f497d; font-size: 11pt;">Chameleon data services</span></b><span style="color: #1f497d; font-size: 11pt;">: Create consumer queries that
extract the information from the combined model into the standard required
using SPARQL queries. <o:p></o:p></span></div>
<ol start="3" type="1">
<ul type="disc">
<li class="MsoNormal" style="color: #1f497d;"><span style="font-size: 11pt;">For example even
though all instrument data is in OPCUA, a consumer could use a Mimosa interface
to fetch this data. The results can then be published as
web-services for consumption by external applications using SPARQLMotion
(</span><span style="color: windowtext;"><a href="http://www.topquadrant.com/products/SPARQLMotion.html">http://www.topquadrant.com/products/SPARQLMotion.html</a></span><span style="font-size: 11pt;">)<o:p></o:p></span></li>
</ul>
</ol>
<div align="center" class="MsoNormal" style="page-break-after: avoid; text-align: center;">
<v:shape alt="End-to-end federation.png" id="Picture_x0020_147" o:spid="_x0000_i1029" style="height: 260.25pt; mso-wrap-style: square; visibility: visible; width: 7in;" type="#_x0000_t75">
<v:imagedata o:title="End-to-end federation" src="file:///C:\Users\PeterL\AppData\Local\Temp\msohtmlclip1\01\clip_image008.png">
</v:imagedata></v:shape></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZLLojGJBIin4iUZns5bf7LGvzn6IcWx_z8mDj8XWzfUmqeR2DgJsNFvCXuh5RDfUzf_PSciH22BhCtReit8fmsfb7JnIxsxIYNFY5y933k2hQJlM-KhOGkDejgkOFbtQpUKzcjGZ5jL-k/s1600/End-to-end+federation.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="205" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZLLojGJBIin4iUZns5bf7LGvzn6IcWx_z8mDj8XWzfUmqeR2DgJsNFvCXuh5RDfUzf_PSciH22BhCtReit8fmsfb7JnIxsxIYNFY5y933k2hQJlM-KhOGkDejgkOFbtQpUKzcjGZ5jL-k/s400/End-to-end+federation.png" width="400" /></a></div>
<div align="center" class="MsoCaption" style="text-align: center;">
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc322162157"><br /></a></div>
<div align="center" class="MsoCaption" style="text-align: center;">
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc322162157">Figure </a>7: Federation End-to-End<span style="color: #1f497d; font-size: 11pt; line-height: 110%;"><o:p></o:p></span></div>
<h3>
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc323387092"><span style="color: #1f497d; font-size: 11pt; font-weight: normal; letter-spacing: 0pt; line-height: 110%;">Let’s
look into these steps in detail:</span></a><span style="color: #1f497d; font-size: 11pt; font-weight: normal; letter-spacing: 0pt; line-height: 110%;"><o:p></o:p></span></h3>
<h3>
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc323387093">Convert to RDF normal form</a></h3>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">Despite the fact that data will be stored in different formats
(relational, XML, object, Excel, etc) according to different schemas they can
always be converted into RDF triples. Always is a strong word, but it really
does work. There are already ways of doing this for any spreadsheet, relational
database, XML schema, and more and it is relatively easy to create
more mappings such as OPC-UA. The data can be left at source and fetched on
demand (federated) or moved into temporary RDF storage. For example, TopBraid
Suite</span><span style="color: #1f497d; font-size: 11pt; line-height: 110%;"> (</span><a href="http://www.topquadrant.com/products/TB_Suite.html"><span style="font-size: 11pt; line-height: 110%;">http://www.topquadrant.com/products/TB_Suite.html</span></a><span style="color: #1f497d; font-size: 11pt; line-height: 110%;">) provides converters and adaptors for all common data sources.</span><span style="color: #1f497d; font-size: 11pt; line-height: 110%;"><o:p></o:p></span></div>
<div align="center" class="MsoNormal" style="page-break-after: avoid; text-align: center;">
<v:shape alt="Datasources to RDF graphs.png" id="Picture_x0020_146" o:spid="_x0000_i1028" style="height: 308.25pt; mso-wrap-style: square; visibility: visible; width: 7in;" type="#_x0000_t75">
<v:imagedata o:title="Datasources to RDF graphs" src="file:///C:\Users\PeterL\AppData\Local\Temp\msohtmlclip1\01\clip_image009.png">
</v:imagedata></v:shape></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWyUSj8oWdtOMq4yw0mET1fOy7JEAHeTviEtR65z7qXMnnPVnGjFgq0Le8TpYN1q_f-PC5QuiGDAnRxIS860hNhogGsVy14vY474_-qo_JPNn9XCPXYcR2YilD95v55YY_uPezTjntr1Zd/s1600/Datasources+to+RDF+graphs.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="242" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWyUSj8oWdtOMq4yw0mET1fOy7JEAHeTviEtR65z7qXMnnPVnGjFgq0Le8TpYN1q_f-PC5QuiGDAnRxIS860hNhogGsVy14vY474_-qo_JPNn9XCPXYcR2YilD95v55YY_uPezTjntr1Zd/s400/Datasources+to+RDF+graphs.png" width="400" /></a></div>
<div align="center" class="MsoCaption" style="text-align: center;">
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc322162158"><br /></a></div>
<div align="center" class="MsoCaption" style="text-align: center;">
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc322162158">Figure </a>8: Conversion to RDF Normal Form</div>
<h3>
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc323387094">Federated Data Model</a></h3>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">A federated data model allows different graphs (aka databases) to be
aggregated by linking the shared objects. This applies to real-time
measurements (OPC-UA), maintenance (MIMOSA), production data (ProdML), or any
external database. We can visualize this as combining the graphs of the
individual operational data stores into a single graph.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt;">Of
course there will be vocabulary differences between the different data-sources.
For example, in the OPC-UA data-source you might have a property OPCUA:hasInstrument,
and in a MIMOSA data-source the equivalent is called Mimosa:Instrumented. So
the federated data model incorporates 'rules' that map one vocabulary to
another. The language of these rules would be RDFS, SKOS, and OWL.
For example, in OWL, you can declare {OPCUA:hasInstrument owl:sameAs
Mimosa:Instrumented}. Note that these are simply additional statements
expressed as RDF triples which are then used by a reasoner to infer
consequences such as :FI101 is actually the same as :10FIC101.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt;">There
will also be identity differences between the different data-sources. These can
also be handled by additional statements, such as {:TANK#102, owl:sameAs,
:TK102 }. This allows a reasoner to infer that the statement {:TK102,
:has_price, 83^^:$} also applies to :TANK#102, implying {:TANK#102, :has_price,
83^^:$}. <o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjehyphenhyphenfYqGrPWEPGLCYZiPQF22en4S101W9zao0l5K8WHnoHwi7fgIU3DBoG4-yuiLt419C51nCDZlfrmHeJus2wN9lmGjWLVp-5Th10W4BHjNwqVLo0u7GuW-m-KFDJrCxjxxBFBww50rqN/s1600/Federated+RDF+graph.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="232" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjehyphenhyphenfYqGrPWEPGLCYZiPQF22en4S101W9zao0l5K8WHnoHwi7fgIU3DBoG4-yuiLt419C51nCDZlfrmHeJus2wN9lmGjWLVp-5Th10W4BHjNwqVLo0u7GuW-m-KFDJrCxjxxBFBww50rqN/s400/Federated+RDF+graph.png" width="400" /></a></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt;"><br /></span></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<v:shape alt="Federated RDF graph.png" id="Picture_x0020_145" o:spid="_x0000_i1027" style="height: 293.25pt; mso-wrap-style: square; visibility: visible; width: 7in;" type="#_x0000_t75">
<v:imagedata o:title="Federated RDF graph" src="file:///C:\Users\PeterL\AppData\Local\Temp\msohtmlclip1\01\clip_image010.png">
</v:imagedata></v:shape></div>
<div align="center" class="MsoCaption" style="text-align: center;">
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc322162159">Figure </a>9: Information Federated from MulTiple
Datasources</div>
<h3>
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc323387095">Chameleon Data Services</a></h3>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">To extract information from the federated information, the best choice
is SPARQL, the semantic equivalent of SQL only simpler. Whilst SQL allows one
to query the contents of multiple tables within a database, SPARQL matches
patterns within the graph. With SQL we need to know in which table each field
belongs. With SPARQL we define the graph pattern that we want to match, and the
query engine will search throughout the federated graphs to find the matches.
In the example illustrated below we do not need to know that the price
attribute comes from one data source, whilst the volume comes from another. In
fact SPARQL allows even further flexibility. The price attribute for Tank#101
could come from a different data source than the price attribute for Tank#102.
This is part of the magic of the semantic technology.<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirQVZTtATt1-8jkqz8zovdPbDn24A5utI0rsDiYoeKhH4RYJ6PJUhdl5a0me01bUWLDTok4CJFotAVNGaHj3eKVvcrDTUgdQGR5RZu-JpyBk-7P_-LP1RUMiSG91VckjtrXwUlT4Yr4RtF/s1600/SPARQL.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="247" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirQVZTtATt1-8jkqz8zovdPbDn24A5utI0rsDiYoeKhH4RYJ6PJUhdl5a0me01bUWLDTok4CJFotAVNGaHj3eKVvcrDTUgdQGR5RZu-JpyBk-7P_-LP1RUMiSG91VckjtrXwUlT4Yr4RtF/s400/SPARQL.png" width="400" /></a></div>
<div class="MsoNormal" style="text-align: center;">
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc322162160" style="text-align: center;">Figure </a><span style="text-align: center;">10</span><span style="text-align: center;">: Graph Pattern matching with SPARQL</span></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">SPARQL can be used to directly query the federated graph for reporting
purposes, however most consumers of the information will expect to interface to
a web-service, with SOAP or REST being the most popular. These services do not
have to be programmed. Instead they can be declared using SPARQLMotion
(http:www.sparqlmotion.org) to produce easily consumed and adaptable
web-services. The designer for SPARQLMotion is shown below:<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQHXjdriJNDx_-g9CE_mrTPDAwYoQCsO_k8dETYVmhCPtfuD4rv6UPhrWcTudzF8n_zZWM22en0QdZICdMjDLuDXheLzzretCxmgNujck_xreOUxDN3KYPdFWH_5jI90AdAOvDXVEeDck9/s1600/SPARQLMotion-Example.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="384" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQHXjdriJNDx_-g9CE_mrTPDAwYoQCsO_k8dETYVmhCPtfuD4rv6UPhrWcTudzF8n_zZWM22en0QdZICdMjDLuDXheLzzretCxmgNujck_xreOUxDN3KYPdFWH_5jI90AdAOvDXVEeDck9/s640/SPARQLMotion-Example.jpg" width="640" /></a></div>
<div class="MsoNormal">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;"><br /></span></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<v:shape alt="SPARQLMotion-Example.jpg" id="Picture_x0020_132" o:spid="_x0000_i1025" style="height: 243pt; mso-wrap-style: square; visibility: visible; width: 405pt;" type="#_x0000_t75">
<v:imagedata o:title="SPARQLMotion-Example" src="file:///C:\Users\PeterL\AppData\Local\Temp\msohtmlclip1\01\clip_image012.jpg">
</v:imagedata></v:shape></div>
<div align="center" class="MsoCaption" style="text-align: center;">
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc322162161">Figure </a>11: Example SPARQLMotion</div>
<h3>
<a href="http://www.blogger.com/blogger.g?blogID=7507012841435012041" name="_Toc323387096">Semantic/RDF advantages for the Process Manufacturing</a></h3>
<div class="MsoNormal" style="margin-left: .25in;">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">Despite solving a complex
data integration problem, Semantic/RDF is inherently simpler. Can there be
anything simpler than storing all knowledge as RDF triples? Despite this simplicity, we do not lose any
expressivity. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .25in;">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">There is no predefined schema
to limit flexibility. However the schema rules, encoded as tables and keys in
the relational model, can still be expressed using RDFS, OWL, and SKOS
statements.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .25in;">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">Deconstructing all
information into statements (triples) allows data from distributed sources to
be easily merged into a single graph.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .25in;">
<span style="color: #1f497d; font-size: 11pt; line-height: 110%;">Any information model can be
reconstructed from the merged graph using SPARQL and presented as web-services
(SOAP or REST).<o:p></o:p></span></div>
<div>
<br />
<hr align="left" size="1" width="33%" />
<div id="ftn1">
<div class="MsoFootnoteText">
<span style="font-size: x-small;"><span class="MsoFootnoteReference"><span class="MsoFootnoteReference"><span style="font-family: 'Tw Cen MT', sans-serif; line-height: 110%;">[1]</span></span></span> MIMOSA is a not-for-profit
trade association dedicated to developing and encouraging the adoption of open
information standards for Operations and Maintenance in manufacturing, fleet,
and facility environments. MIMOSA's open standards enable collaborative asset
lifecycle management in both commercial and military applications.</span></div>
</div>
<div id="ftn2">
<div class="MsoFootnoteText">
<span style="font-size: x-small;"><span class="MsoFootnoteReference"><span class="MsoFootnoteReference"><span style="font-family: 'Tw Cen MT', sans-serif; line-height: 110%;">[2]</span></span></span> The Unified Architecture
(UA) is THE next generation OPC standard that provides a cohesive,
secure and reliable cross platform framework for access to real time and
historical data and events.<span class="apple-converted-space"><span style="font-family: Verdana, sans-serif;"> </span></span></span></div>
</div>
<div id="ftn3">
<span style="font-size: x-small;"><span class="MsoFootnoteReference"><span class="MsoFootnoteReference"><span style="font-family: 'Tw Cen MT', sans-serif; font-weight: normal; letter-spacing: 1pt; line-height: 110%;"><span style="color: black;">[3]</span></span></span></span> <span style="font-weight: normal; letter-spacing: 0pt;">WITSML™ (Wellsite Information Transfer
Standard Markup Language) is an industry initiative to provide open,
non-proprietary, standard interfaces for technology and software that monitor
and manage wells, completions and workovers.</span></span><br />
<span style="font-size: x-small; font-weight: normal;"><span class="MsoFootnoteReference"><span class="MsoFootnoteReference"><span style="font-family: 'Tw Cen MT', sans-serif; line-height: 110%; text-transform: uppercase;">[4]</span></span></span>
ISO 15926 provides integration of life-cycle
data for process plants including oil and gas production facilities</span><br />
<br /></div>
<div id="ftn5">
<div class="MsoFootnoteText">
<span style="font-size: x-small;"><span class="MsoFootnoteReference"><span class="MsoFootnoteReference"><span style="font-family: 'Tw Cen MT', sans-serif; line-height: 110%;">[5]</span></span></span> I should really be using
URIs instead of text labels for subject, property, and objects, but the intent
of the semantic model is conveyed more simply if we avoid identifiers like ‘http://www.example.org/equipment#Pump101’
and use :Pump#101</span></div>
</div>
<div id="ftn6">
<div class="MsoFootnoteText">
<span style="font-size: x-small;"><span class="MsoFootnoteReference"><span class="MsoFootnoteReference"><span style="font-family: 'Tw Cen MT', sans-serif; line-height: 110%;">[6]</span></span></span> SPARQL is a query language
for RDF. A <a href="http://semanticweb.org/wiki/SPARQL" title="SPARQL"><b>SPARQL</b></a><b>
endpoint</b> is a protocol service that makes it possible to query a data
source using SPARQL. The source itself does not need to be in RDF. It can, for
example, be a traditional relational database. Later in this article we will
describe SPARQL in more detail and show some query examples.</span></div>
</div>
</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7507012841435012041.post-6257473109616586552011-12-02T07:09:00.000-08:002011-12-16T13:51:37.783-08:00Publishing HTML created with SPARQL Web Pages<p style="font-family: arial, helvetica; font-size: 13px; text-align: -webkit-auto; "><a href="http://topquadrantblog.blogspot.com/2011/11/creating-topbraid-mobile-web-app-with.html">Last week</a> we saw how to use SPARQL Web Pages (SWP) to render customized HTML of individual class instances and how to create a web page of all that class's instances with a title at the top. The fine-grained control that SWP gives us over the generated HTML let us take advantage of the jQuery Mobile libraries so that the sample TopBraid application generated web pages appropriate for a smartphone interface, with buttons that expand and collapse at your touch to display details about each class instance.</p><p style="font-family: arial, helvetica; font-size: 13px; text-align: -webkit-auto; ">Testing this application meant choosing from two alternatives:</p><ul style="font-family: arial, helvetica; font-size: 13px; text-align: -webkit-auto; "><li style="font-size: 10pt; "><p style="font-size: 10pt; ">The first was to run it on TopBraid Composer's built-in TopBraid Live Personal Server, which let us look at the page from any web browser running on the same machine.</p></li><li style="font-size: 10pt; "><p style="font-size: 10pt; ">Uploading the application's project to a TopBraid Live Enterprise Server, where multiple devices, including phones, could access it.</p></li></ul><p style="font-family: arial, helvetica; font-size: 13px; text-align: -webkit-auto; ">Either way, because TopBraid Live generates these web pages dynamically, if the underlying data is changed, refreshed versions of the web page would reflect this, making TopBraid a great platform for interactive semantic web applications for any device.</p><p style="font-family: arial, helvetica; font-size: 13px; text-align: -webkit-auto; ">You don't have to have a TopBraid Live Enterprise server to deliver pages generated by SWP, though. A simple SPARQLMotion script can save your formatted HTML in disk files that you can copy to a web server that may or may not have TopBraid Live installed. Using this technique, you can use the TopBraid platform to create semantic content publishing applications as well as interactive applications.</p><p style="font-family: arial, helvetica; font-size: 13px; text-align: -webkit-auto; ">The following SPARQLMotion script, which is stored in the application file described last week, does this for the mobile Kennedys web application.</p><center style="font-family: arial, helvetica; font-size: 13px; "><img src="http://www.topquadrant.com/resources/blog/mobileKennedysSMScript.jpg" alt="mobile Kennedys app SPARQLMotion script" width="450" /></center><p style="font-family: arial, helvetica; font-size: 13px; text-align: -webkit-auto; ">The first module is an sml:ImportRDFFromWorkspace module that reads the file that this script is stored in. That file has the Kennedys data and the SWP formatting markup so that this data can be fed to the next step in the process.</p><p style="font-family: arial, helvetica; font-size: 13px; text-align: -webkit-auto; ">The second module, named mk:GenerateHTML, is an sml:CreateUISPINDocument SPARQLMotion module (from the Text Processing section of the SPARQLMotion palette) whose key setting is its sml:view property, which has the following:</p><pre style="margin-top: 14pt; margin-bottom: 14pt; margin-left: 0pt; font-size: 13px; text-align: -webkit-auto; "><pre style="margin-top: 14pt; margin-bottom: 14pt; margin-left: 0pt; "><ui:resourceView<br /> ui:resource="&lt;http://topbraidlive.org/mobileKennedys&gt;"/><br /></pre></pre><p style="font-family: arial, helvetica; font-size: 13px; text-align: -webkit-auto; ">It's a snippet of XML specifying that the module should create a resource view for the specified resource, which is identified here with a complete URI. (The URI's delimiting angle brackets are escaped because they're in an XML attribute.) The real work to make this happen was all described in the last blog entry, which showed how the SWP code to generate a complete web page was attached to the<tt><http: org="" mobilekennedys=""></http:></tt> resource. The mk:GenerateHTML module in this script also specifies that this generated markup will be stored in a variable named <tt>doc</tt>.</p><p style="font-family: arial, helvetica; font-size: 13px; text-align: -webkit-auto; ">The final mk:SaveFile module in the script is an sml:ExportToTextFile module that saves the contents of the <tt>doc</tt> variable (set in the module's sml:text property as the SPARQL expression <tt>?doc</tt>) to a file called output.html. I also set sml:replace to true so that repeated execution of the script wouldn't append the output onto the result of previous runs.</p><p style="font-family: arial, helvetica; font-size: 13px; text-align: -webkit-auto; ">After you run this script you'll have a web page called output.html that looks like the display shown in the phone browsers in last week's blog entry, and you can copy this file to any web server you want.</p><p style="font-family: arial, helvetica; font-size: 13px; text-align: -webkit-auto; ">This script is very simple. As you bring other SPARQLMotion capabilities into it such as inferencing and reading from all the data formats that TopBraid understands, you can make it much more sophisticated. You can also configure the script to save a collection of multiple files, letting you publish large collections of data in pieces that are digestible for typical browsers. (Phone browsers in particular can get sluggish; my Android LG Ally is not a recent model, and the expanding and collapsing of information about each person on the display of this app is not as quick on the Ally as I'd like it to be.)</p><p style="font-family: arial, helvetica; font-size: 13px; text-align: -webkit-auto; ">So, use your imagination to add new features to this SPARQLMotion script, and you can create dynamic or static web pages for phones or any other kinds of browsers, with all the power of TopBraid behind your application development.</p>Bob DuCharmehttp://www.blogger.com/profile/02742075186312518829noreply@blogger.com1tag:blogger.com,1999:blog-7507012841435012041.post-89111272360373912292011-11-22T07:18:00.000-08:002014-05-08T12:47:54.967-07:00Creating a TopBraid mobile web app with SPARQL Web Pages<div id="i0"><p>I've <a href="http://topquadrantblog.blogspot.com/2010/11/getting-started-with-sparql-web-pages.html">written here before</a> about how <a href="http://uispin.org/">SPARQL Web Pages</a> (SWP) let you convert your RDF to HTML or XML by embedding SPARQL queries into the appropriate markup. In that very simple example, I showed how to create a web page for an address book entry and then display it both in TopBraid Composer and in a regular web browser.</p><p>Today I'm going to show how I did something similar to display a single Person instance from the Kennedys sample data included with TopBraid Composer and then defined a page that showed all the people in that data model. You can download and try the project <a href="http://www.topquadrant.com/resources/blog/mobileKennedys.zip">here</a>. The fun part was displaying it so that it looks like a proper mobile web page on a phone's web browser, as shown here on an Android phone and on an iPhone turned sideways to test the re-orienting capability of the display.</p><center><a href="http://topquadrant.com/images/KennedysOnPhones.jpg"><img src="http://topquadrant.com/images/KennedysOnPhones.jpg" alt="app output on LG Ally and iPhone" border="0" width="400" /></a></center><br /><br /><p>Touching someone's name on the phone expands the display to show the remaining property names and values about that person underneath his or her name. In the picture, I've just touched Andrew Cuomo's name on the Android phone and Edward Kennedy Jr's name on the iPhone, displaying details about each of them below their names. Touching the names again hides their data. </p><p>In the picture, the two phone browsers are displaying the output of a TopBraid Live server running this application. As we'll see in the sequel to this blog entry, you can use the same SPARQL Web Page configuration to save HTML disk files with all of this formatting so that the phone browsers could view the static web pages stored on a server that didn't have TopBraid Live installed.</p><p>To enable proper mobile display, I used the <a href="http://jquerymobile.com/">jQuery Mobile</a> library. <a href="http://jquery.com/">jQuery</a> is a set of Javascript and CSS libraries designed to let you add sophisticated user interfaces to your web pages without worrying about cross-browser compatibility, and jQuery Mobile is a branch of this project specialized for mobile phones. You don't need to know any JavaScript or CSS to use these libraries; if you're happy with one of their display configuration, using these libraries is usually just a matter of including the right file links in your HTML's <tt>head</tt> element and then setting certain attributes in your HTML elements to reference the libraries. </p><p>I began this application by creating an RDF/SPARQLMotion file in TopBraid Composer with a base URI of http://topbraidlive.org/mobileKennedys. I needed SPARQLMotion for the script that creates the static disk file version of the Kennedys display that we'll learn about next week. Next, I imported the kennedys.rdf model from the /TopBraid/Examples folder in the Navigator view. I also imported the SWP html.rdf and tui.rdf models from the Navigator's /TopBraid/UISPIN folder. (This all works the same when the files to import are Turtle ttl files instead of RDF/XML files.)</p><p>After importing the necessary files, the next step was to set up the display of data about a Person instance. After importing the files described above, clicking on kennedys:Person under owl:Thing on the Class view shows that the presence of the SWP libraries has added a ui:instanceView property to the kennedys:Person class form. I could have put the HTML to display a person here, like I did with the address book display in the blog entry mentioned above, but for greater flexibility, I created a separate PersonView class to store this markup and pointed at this class from the Person class's ui:instanceView value.</p><p>I created this mk:PersonView class (I had assigned the prefix "mk:" to the URI http://topbraidlive.org/mobileKennedys#) as a child of the ui:Element class, which is a child of the ui:Node class added by the SWP libraries. The ui:prototype property on this class's form is the place for the formatting code and markup, but I did a few setup steps before setting it:</p><ul><li><p>Because the app needs to pass a parameter to the code in ui:prototype specifying which person to display, I had to define that parameter. To do this, I created an sp:person child of the sp:arg property in the Properties view to represent the person argument value passed to the prototype. Next, I dragged the new property from the Properties view to the spin:constraint property name on the mk:PersonView form to indicate that this would store the argument passed to the code and markup used to display a single person. This displays the "Create from SPIN template" wizard with all the values filled out the way I needed them, so I just clicked the OK button.</p></li><li><p>JQuery implements some of its magic with HTML extension attributes named <tt>data-collapsed</tt> and <tt>data-role</tt>. TopBraid Composer helps you assemble proper HTML by flagging any non-HTML markup, and it won't like these because they're not declared as HTML 4 properties. So, I declared them myself by making two clones of the html:class property (a subproperty of html:attributes) and renamed them html:data-collapsed and html:data-role. This way, TopBraid Composer wouldn't prevent me from saving HTML markup that used these properties as attributes.</p></li><li><p>When listing each person's property names and values (for example, Andrew Cuomo's year of birth and first name in the picture above), I certainly didn't want to list the full URI of each property name. Ideally, each property would have an rdfs:label value that I could display instead; if not, I thought it best to just show the local name of the property's URI. To make this easier, I created a new function called mk:bestName as a subclass of spin:Functions (itself a subclass of spin:Modules). I defined a spin:constraint of sp:arg1 for this function and then defined this spin:body for it:</p><pre>SELECT ?label<br />WHERE {<br /> BIND (spif:name(?arg1) AS ?name) .<br /> BIND (IF(fn:contains(?name, ":"), afn:localname(?arg1), ?name) AS ?label) .<br />}<br /></pre><p>mk:bestName is a good general-purpose function. It calls the SPIN spif:name function, which gets a resource's skos:prefLabel value if available or an rdfs:label value as a second choice. If neither is available, mk:bestName takes the local name of the URI or prefixed name that got returned.</p></li><li><p>Because members of the kennedys:Person class might have a kennedys:name value that I'd prefer the application to use if available, I declared a similar but more specialized function for the Kennedys data called mk:bestKennedyName. This is also as a subclass of spin:Functions, and has a spin:constraint of sp:arg1 and the following as a spin:body:</p><pre>SELECT ?label<br />WHERE {<br /> OPTIONAL {<br /> ?arg1 kennedys:name ?kname .<br /> } .<br /> BIND (spif:name(?arg1) AS ?name) .<br /> BIND (COALESCE(?kname, IF(fn:contains(?name, ":"), afn:localname(?arg1), ?name)) AS ?label) .<br />}}<br /></pre><p>This function body takes advantage of SPARQL 1.1's new <a href="http://www.w3.org/TR/sparql11-query/#func-coalesce"><tt>COALESCE()</tt></a> function, which returns the value of the first parameter passed to it that can be evaluated without an error.</p></li></ul><p>With the functions, the HTML extensions, and the argument to pass to it all set up for the formatting markup in the mk:PersonView class, I was ready to add that markup and SPARQL code to the ui:prototype property of my new class. It's mostly HTML <tt>div</tt> elements with attributes set according to the models I saw in the source of the <a href="http://jquerymobile.com/demos/1.0/">jQuery Mobile demos</a>. The "collapsible" part means that initially only the kennedys:name value will display, as an <tt>h3</tt> element, and that clicking on that name (or, on a phone, touching it) will toggle the display of the remaining property names and values about that person.</p><pre><div data-collapsed="true" data-role="collapsible"><br /> <h3>{= spl:object(?person, kennedys:name) }</h3><br /> <div class="ui-grid-a"><br /> <ui:forEach ui:resultSet="{#<br /> SELECT ?propertyName ?bestValueLabel<br /> WHERE {<br /> ?person ?property ?value .<br /> BIND (mk:bestName(?property) AS ?propertyName) .<br /> BIND (IF(isIRI(?value), mk:bestKennedyName(?value), ?value)<br /> AS ?bestValueLabel) .<br /> }<br /> ORDER BY (?property) }"><br /> <div class="ui-block-a"><br /> <div class="ui-bar ui-bar-c">{= ?propertyName }</div><br /> </div><br /> <div class="ui-block-b"><br /> <div class="ui-bar ui-bar-c">{= ?bestValueLabel }</div><br /> </div><br /> </ui:forEach><br /> </div><br /></div><br /></pre><p>When you use SWP to define an HTML <tt>div</tt> element with the data and markup to display something, the SWP engine will create <tt>html</tt>, <tt>head</tt>, and <tt>body</tt> wrapper elements to ensure that a browser viewing the HTML gets a complete web page. The SWP ui:headIncludes property, which you'll see on the mk:PersonView class form with ui:prototype and the other properties there, lets you specify custom markup to add to the HTML <tt>head</tt> element when the SWP engine sends the web page to the requesting browser. I added the following to this property; it has the <tt>meta</tt>, <tt>link</tt>, and <tt>script</tt> elements necessary to make the resulting HTML a proper jQuery Mobile page:</p><pre><ui:group><br /> <meta content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"<br /> name="viewport"/><br /> <link href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css"<br /> rel="stylesheet"/><br /> <script src="http://code.jquery.com/jquery-1.6.4.min.js"/><br /> <script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"/><br /></ui:group><br /></pre><p>Then, going back to the kennedys:Person element, I added this ui:instanceView value for it to point at the mk:PersonView class I had created:</p><pre><mk:PersonView sp:person="{= ?this }"/><br /></pre><p>The <tt>?this</tt> variable passes the Person instance currently being processed to be used as the <tt>?person</tt> value in the SPARQL query in the mk:PersonView ui:prototype value.</p><p>This is all enough to display a single person, but I wanted to display all the Person instances in a sorted list. I attached this view's definition to the ontology resource itself by clicking on the little house icon at the top of TopBraid Composer and then adding this ui:view value to it (note that ui:view wasn't already part of the form, so I dragged it on there from TopBraid Composer's Properties view): </p><pre><div><br /> <div data-role="header"><br /> <h1>Kennedys List</h1><br /> </div><br /> <div data-role="collapsible-set"><br /> <ui:forEach ui:resultSet="{#<br /> SELECT ?p<br /> WHERE {<br /> ?p a kennedys:Person .<br /> ?p kennedys:lastName ?lname .<br /> }<br /> ORDER BY (?lname) }"><br /> <ui:resourceView ui:resource="{= ?p }"/><br /> </ui:forEach><br /> </div><br /></div><br /></pre><p>As with the code to display each individual Person instance, this markup is mostly <tt>div</tt> elements with attribute settings based on the source of the jQuery Mobile demos I saw. The ui:resourceView element inside the ui:forEach element tells the SWP engine to display the resource according to whatever view was specified for it. In this case, the resource is a kennedys:Person instance, because that's what the SPARQL here query binds to the <tt>?p</tt> variable, so it will use the view defined earlier. </p><p>To test this, I sent a browser to the URL <tt>http://localhost:8083/tbl/uispin?_resource=http://topbraidlive.org/mobileKennedys</tt>. (URLs for SPARQL Web Page applications often include a <tt>&_base</tt> parameter to identify the graph of data to use—in this case, it would be <tt>&_base=http://topbraid.org/examples/kennedys</tt>—but that was unnecessary here because one of the first steps of creating the mobileKennedys model was dragging the Kennedys data onto its Include tab, so it already knew which data to use.) The <tt>_resource</tt> parameter tells it which resource to render, so I used my file's base URI here because that's where I attached the markup and SPARQL code to display the full web page. These and other parameters are described in the <a href="http://uispin.org/ui.html">SWP documentation</a>.</p><p>This should work with any browser. (I recently discovered that picking User Agent from Safari's Develop menu lets you set Safari to emulate a variety of other browser, including the mobile versions that run on the iPhone and iPad, which helped me to debug some early problems I had with getting the jQuery Mobile code right.) Because you can't access TopBraid Composer's built-in copy of the TopBraid Live Personal edition from a different computer, there's no way for a phone's browser to access this application when running it on TopBraid Composer, so I uploaded the project storing this application to a copy of TopBraid Live to do the test shown in the photograph above.</p><p>Next week, I'll show how I extended this application to save a static HTML file of the mobile web display of Kennedys data as an alternative to the TopBraid Live server's dynamic display. I could then copy that file to a web server that doesn't necessarily have TopBraid Live installed on it. Then, any computer or phone web browser can display it. For a preview of how it looks, send your phone's browser to <a href="http://www.topquadrant.com/resources/blog/k/">http://www.topquadrant.com/resources/blog/k/</a>—or, if you want a shorter URL to type on your phone, <a href="http://bit.ly/topqkm">http://bit.ly/topqkm</a>.</p></div>Bob DuCharmehttp://www.blogger.com/profile/02742075186312518829noreply@blogger.com1tag:blogger.com,1999:blog-7507012841435012041.post-61594019045370307792011-09-30T10:32:00.000-07:002011-09-30T17:45:41.572-07:00Ontologies and Data Models – are they the same?Yesterday a question about how ontologies may be different from logical data models was asked by a newcomer on <a href="http://groups.google.com/group/topbraid-users">TopBraid Users Forum</a>. As to be expected on the TopBraid Forum, by ontologies he meant specifically ontology models expressed in RDFS/OWL. Because we frequently hear this or similar questions in our trainings, workshops and in conversations with customers, I decided to respond in a blog post instead of writing an e-mail.<br />
<br />
Data modeling was invented more than thirty years ago to help with the design of databases, specifically, relational databases. As quoted below, ANSI definition from 1975 differentiated between three data models – conceptual, logical and physical. Data modeling quickly became recognized as a tool for analyzing the semantics of an organization with the respect to the structure and flow of the information used in carrying out organization’s activities. Wikipedia offers the following definition of <a href="http://en.wikipedia.org/wiki/Data_modeling">Data Modeling</a>:<br />
<blockquote style="background-color: #d0e0e3;">
<span style="font-size: x-small;">Data modeling is a method used to define and analyze data requirements needed to support the business processes of an organization. The data requirements are recorded as a conceptual data model with associated data definitions. Actual implementation of the conceptual model is called a logical data model. </span><br />
<span style="font-size: x-small;"><…></span><br />
<span style="font-size: x-small;">In 1975 ANSI described three kinds of data-model instance:</span><br />
<ul>
<li><span style="font-size: x-small;">Conceptual schema: describes the semantics of a domain (the scope of the model). For example, it may be a model of the interest area of an organization or of an industry. This consists of entity classes, representing kinds of things of significance in the domain, and relationships assertions about associations between pairs of entity classes. A conceptual schema specifies the kinds of facts or propositions that can be expressed using the model. In that sense, it defines the allowed expressions in an artificial "language" with a scope that is limited by the scope of the model.</span></li>
<li><span style="font-size: x-small;">Logical schema: describes the structure of some domain of information. This consists of descriptions of (for example) tables, columns, object-oriented classes, and XML tags.</span></li>
<li><span style="font-size: x-small;">Physical schema: describes the physical means used to store data. This is concerned with partitions, CPUs, tablespaces, and the like.</span></li>
</ul>
<span style="font-size: x-small;">According to ANSI, this approach allows the three perspectives to be relatively independent of each other. Storage technology can change without affecting either the logical or the conceptual model. The table/column structure can change without (necessarily) affecting the conceptual model.</span></blockquote>
These definitions describe a clear progression from conceptual to logical to physical data models. SInce their origin is in the 70s, they reflect certain technology assumptions than no longer hold true.<br />
<br />
When information modeling is done to create a relational database, conceptual model must be different from a logical model because there is no place in a relational database structure to capture, for example, business rules, create subsumtion relationships and describe other key aspects of a conceptual model. This semantic information collected and documented as part of the initial modeling is left behind when modelers and designers move on to define a logical data model. The "left behind" parts are used by software developers as they encode business semantics directly into custom programs.<br />
<br />
Logical data model is a subset of a conceptual model that can be expressed using a particular technology. However, there are always some performance considerations that require additional changes to the logical data model before it can be implemented in a relational database. Hence, some of the aspects of a logical model are left behind as it gets translated into a physical data model.<br />
<br />
Since an ontology is a model of a domain describing objects that inhabit it, all three types of data models can be thought of as ontologies. They range from the most expressive one that describes business concepts and processes (the conceptual model) to less expressive and progressively moving from describing business semantics to describing physical structures of the data as it is stored in the databases (the logical and physical data model). Physical model can be thought of as an ontology of a particular database. Wikipedia goes on to note <br />
<blockquote style="background-color: #d0e0e3;">
<span style="font-size: x-small;">Early phases of many software-development projects emphasize the design of a conceptual data model. Such a design can be detailed into a logical data model. In later stages, this model may be translated into physical data model. <i><b>However, it is also possible to implement a conceptual model directly.</b></i></span></blockquote>
Semantic Web standards (governed by the W3C, the World Wide Web Consortium) make it possible to implement conceptual models <b>directly</b>. This is possible due to the layered architecture of the Semantic Web technology stack consisting of:<br />
<ul>
<li><span style="font-weight: bold;">RDF –</span> a canonical data model that is like relational data model in its ability to connect related objects and unlike relational data model in that the data objects (or resources in RDF-speak) are highly granular. </li>
</ul>
<div style="background-color: #fff2cc;">
The smallest unit of information in RDF is not a table or a row in a table, but individual statements – a single fact about a resource. </div>
<div style="background-color: #fff2cc;">
<br /></div>
<div style="background-color: #fff2cc;">
These statements are called RDF triples. For example, “<i>Atlantis decommission-date July, 2011</i>” is a triple where <i>Atlantis</i> is a subject of a triple, <i>decommission date</i> is a predicate of a triple and <i>July, 2011</i> is an object of a triple. <i>Atlantis</i> and <i>decommission date</i> are RDF resources and <i>July, 2011</i> is XML literal. Subjects and predicates of a triple are always RDF resources. An object can be either a resource or a literal value. Predicates that connect two resources are relationships or associations in the data modeling speak. Predicates connecting a resource to a literal value are attributes. In RDF they are called respectively object and data properties.</div>
<div style="background-color: #fff2cc;">
<br /></div>
<div style="background-color: #fff2cc;">
Because RDF model is highly canonical, RDF data is schema-less. There are no constraints that require it to fit into tables or hierarchies. RDF data is simply a network of connected triples. As such, it can be used to represent, if needed, both - table structures and hierarchies. Standard mappings have been defined from relational tables and XML hierarchies into RDF.</div>
<div style="background-color: #fff2cc;">
<br /></div>
<div style="background-color: #fff2cc;">
Another key differentiating factor of RDF is that it was “born on the web”. Each RDF resource has a globally unique identity, a URI (uniform resource identifier). For example, the URI for Atlantis may be http://www.nasa.gov/shuttle/Atlantis and the URI for a decommission date may be http://www.nasa.gov/lifecycle#decommissionDate . As a result, it is possible to link RDF data over web in a way similar to how documents can be hyperlinked over the web. By web we mean all HTTP based networks including intranets and extranets.</div>
<div style="background-color: #fff2cc;">
<br /></div>
<div style="background-color: #fff2cc;">
RDF databases store and provide query access to RDF data. Just like there are standard languages for query of relational and XML data, there is a standard for querying RDF. It is called <a href="http://www.w3.org/TR/rdf-sparql-query/">SPARQL</a>. True to the web-native nature of RDF, SPARQL is not only a query language, but also a protocol that makes it possible to access RDF data over HTTP.</div>
<ul>
<li><b>RDFS (RDF Schema) and OWL (Web Ontology Language) </b>– RDF-based languages for expressing business semantics.</li>
</ul>
<div style="background-color: #fff2cc;">
Jointly RDFS and OWL offer ability to define classes or groups of resources that share common characteristics such as Vehicles and Space Shuttles. The richness of RDFS/OWL makes it possible to fully express the meaning of the business concepts. Data models in RDFS/OWL are stored in the same way as the data, in RDF triples. For example, we can have triples stating that <i>Space Shuttle</i> is a <i>Class</i> and it is a sub class of a <i>Vehicle</i> class and that a vehicle can have only one decommission date (cardinality = 1) and its value must be xsd:date. And you can go beyond cardinality and use the Semantic Web standards to represent a variety of business rules.</div>
<div style="background-color: #fff2cc;">
<br /></div>
<div style="background-color: #fff2cc;">
Since the data and the schema are stored in the same way, it is possible to query schemas the same way data is queried and to combine search criteria about schemas with the search criteria about data. For example, we can create SPARQL queries to ask for all vehicles that have been decommissioned, all subclasses of a vehicle class, all relationships and attributes a vehicle should have and, when returning decommissioned vehicles, to provide only data values for the fields that have cardinality = 1.</div>
<div style="background-color: #fff2cc;">
<br /></div>
<div style="background-color: #fff2cc;">
The use of RDF means that the modeling constructs and definitions can be linked and connected. Organizations can refer to each other’s business definitions. Models can be modularized and re-used where appropriate. Differences between related, but not identical concepts can be described. All of this can now be done in a standard compliant and interoperable way.</div>
<br />
A growing number of standards bodies and communities of interest are publishing RDF/OWL data models for their particular domains. For example:<br />
<ul>
<li><a href="http://www.w3.org/2009/08/skos-reference/skos.html">SKOS</a> – provides a way to represent taxonomies and thesauri</li>
<li><a href="http://en.wikipedia.org/wiki/ISO_15926%20">ISO 15926</a> – offers a data model for sharing life-cycle data for process plants including oil and gas production facilities </li>
<li><a href="http://www.w3.org/TR/mediaont-10/">Ontology for Media Resources</a> - defines a core set of metadata properties for multimedia resources</li>
<li><a href="http://sioc-project.org/ontology">SIOC</a> - defines information about online communities</li>
<li><a href="http://qudt.org/">QUDT</a> - provides models describing measurable quantities, units for measuring different kinds of quantities and the data types used to store and manipulate these objects in software</li>
<li><a href="http://trdf.sourceforge.net/provenance/ns.html">Provenance Vocabulary</a> - defines provenance-related metadata</li>
</ul>
There is much more that can be added to this post including a discussion on the best practices for ontology modeling, ontology architecture, approaches for connecting and mapping models, using rules and constraints, publishing, versioning and governing models. Each of these topics, however, deserves an exploration in its own right.<br />
<br />
I will end by pointing to a few relevant related blogs and web pages we have published before:<br />
<ul>
<li>How to extend an ontology <a href="http://topquadrantblog.blogspot.com/2011/03/how-to-extend-ontology.html">http://topquadrantblog.blogspot.com/2011/03/how-to-extend-ontology.html </a></li>
<li>Ontology Mapping with SPINMap <a href="http://topquadrantblog.blogspot.com/search/label/SPINMap">http://topquadrantblog.blogspot.com/search/label/SPINMap</a> </li>
<li>Training on RDF, OWL and ontology modeling <a href="http://www.topquadrant.com/training/training_overview.html">http://www.topquadrant.com/training/training_overview.html </a></li>
<li>Transforming XML Schemas and XML into RDF/OWL <a href="http://topquadrantblog.blogspot.com/2011/09/living-in-xml-and-owl-world.html">http://topquadrantblog.blogspot.com/2011/09/living-in-xml-and-owl-world.html </a></li>
<li>Converting UML models to OWL<a href="http://www.blogger.com/goog_1739819784"> </a><a href="http://topquadrantblog.blogspot.com/2011/02/converting-uml-models-to-owl-part-1.html">http://topquadrantblog.blogspot.com/2011/02/converting-uml-models-to-owl-part-1.html </a></li>
</ul>
Irene Polikoffhttp://www.blogger.com/profile/17834271916697741738noreply@blogger.com4tag:blogger.com,1999:blog-7507012841435012041.post-78605186980412601862011-09-28T23:03:00.000-07:002011-09-29T16:46:35.540-07:00Living in the XML and OWL World - Comprehensive Transformations of XML Schemas and XML data to RDF/OWL<div><link href="http://www.linkedmodels.org/styles/blog-styles.css" rel="stylesheet" type="text/css"/> <link rel="stylesheet" type="text/css" href="http://www.w3.org/TR/rdf-sparql-query/local.css" /><script type="text/javascript"> var newwindow; function diagramPopUp(url) newwindow=window.open(url,'name','height=600,width=1000,left=50,top=50,resizable=yes,scrollbars=yes,toolbar=no,status=yes'); if (window.focus) {newwindow.focus()} </script><p>Many enterprise information models are expressed using XML Schemas. Data between applications is commonly exchanged in XML, compliant with those schemas. Connecting XML data from different systems in a coherent aggregated way is a challenge that confronts many organizations. Capabilities of RDF/OWL to describe semantics of different data models and aggregate disparate data are a natural fit for addressing these challenges.</p><p>For a number of years now, <a href="http://www.topquadrant.com/products/TB_Composer.html">TopBraid Composer</a> included the ability to convert XSDs and associated XML files to RDF/OWL. However, for some XML Schemas our converter did not work as well as customers needed. For the upcoming TopBraid Composer 3.6.0 release, it was significantly improved to have a more comprehensive coverage of XSD constructs and more meaningful conversion to OWL. In parallel, we improved our XML data conversion to RDF so that transformations automatically happen based on the generated OWL models. And we have improved performance of the transformations.</p><p>An overview of the approach is illustrated in the following figure:</p><a href="http://www.linkedmodels.org/images/xsd2owl/xsd-xml-to-owl-approach.png" onclick="diagramPopUp(this.href); return false;"> <img src="http://www.linkedmodels.org/images/xsd2owl/xsd-xml-to-owl-approach.png" alt="Approach" class="center" width="500 px;" height="327 px;" /> </a><p>Since, the conversion occurs automatically, users do not have to worry about writing any rules for commonly needed mappings. However, those users that need to make further transformations can use <a href="http://www.spinrdf.org">SPARQL Rules</a> and <a href="http://topquadrant.com/products/SPARQLMotion.html">SPARQLMotion</a> to customize their generated OWL ontology or further transform RDF triples representing the XML data.</p><p>The content of this blog is organized as follows:</p><ul><li><a href="#xml-schemas-converted-as-part-of-our-tests">XML Schemas converted as part of our tests</a></li><li><a href="#some-challenges-in-converting-xml-schemas-to-owl">Some challenges in converting XML Schemas to OWL</a></li><li><a href="#illustrative-example-of-transformation-rules">Illustrative example of transformation rules</a></li><li><a href="#another-example-of-transformation-rules">Another example of transformation rules</a></li><li><a href="#complete-table-of-supported-transformations">Complete table of supported transformations</a></li><li><a href="#a-sparql-metric-query">A SPARQL Metric Query</a></li><li><a href="#concluding-remarks">Concluding remarks</a></li></ul><h3 id="xml-schemas-converted-as-part-of-our-tests"><a href="#TOC">XML Schemas converted as part of our tests</a></h3><p>We tested the importer on a broad range of complicated and large-scale industry standard XSD files, and converted many XML instances with impressive results. The XSDs we have tested with the new importer include:</p><ol><br /><li>Banking<ul><li><a href="http://www.fpml.org/">FpML</a>, the Financial products Markup Language</li><li><a href="http://www.iso20022.org/">ISO 20022</a>, a standard for Universal financial industry message scheme</li></ul></li><br /><li>Energy and Utilities<ul><li><a href="http://www.multispeak.org/Pages/default.aspx">MultiSpeak</a>, de-facto standard for defining data needed to be exchanged between software applications in order to support the business processes commonly applied at utilities</li></ul></li><br /><li>Government<ul><li><a href="http://cio-nii.defense.gov/sites/dodaf20/">DoDAF</a>, the Department of Defense Architecture Framework</li><li><a href="https://www.niem.gov/">NIEM</a>, the U.S. National Information Exchange Model</li></ul></li><br /><li>Oil and Gas<ul><li><a href="http://15926.org/home/tiki-index.php/">ISO 15926</a>, a standard for integration of life-cycle data for process plants including oil and gas production facilities</li><li><a href="http://www.energistics.org/witsml-standard/">WITSML</a>, Wellsite Information Transfer Standard Markup Language</li></ul></li><br /><li>Healthcare<ul><li><a href="http://www.hl7.org/">HL7</a></li></ul></li><br /><li>Electronics<ul><li><a href="http://www.accellera.org/activities/ip-xact/">IP-XACT</a>, the XML Schema for meta-data documenting Intellectual Property (IP) used in the development, implementation and verification of electronic systems</li></ul></li><br /><li>Other<ul><li><a href="http://zone.ni.com/devzone/cda/tut/p/id/3893">ATML</a>, the Auto-Test Markup Language</li><br /></ul></li></ol><p>Some of the converted schemas will be published at <a href="http://linkedmodels.org/">LinkedModels.org</a>. To get an early access to converted models or for any other questions, contact us at TopQuadrant.</p><p>The examples we use in this blog are mainly from the Financial products Markup Language (FpML). All FpML 5.2 XSD and XML instance files were tested. An example is transparency standard under FpML, for which the <code>transparency.ttl</code> ontology was generated from 23 XSD files.</p><br /><h3 id="some-challenges-in-converting-xml-schemas-to-owl"><a href="#TOC">Some challenges in converting XML Schemas to OWL</a></h3><br /><p>Some of the challenges in converting XSD to OWL that were addressed are:</p><ol><li>Transforming of anonymous types</li><li>Converting complex types with simple contents</li><br /><li>Resolving conflicting nested element and attribute names during OWL property generation</li><br /><li>When and how to distinquish global elements from complex types with similar names during OWL class generation</li><br /><li>Generating enumerations</li><br /><li>Handling substitution groups both at the XSD and XML levels</li><br /><li>Handling the overriding of an XSD type with <code>xsi:type</code> in XML</li></ol><p>The example that follows shows the approaches that we have used for the transformation.</p><h3 id="illustrative-example-of-transformation-rules"><a href="#TOC">Illustrative example of transformation rules</a></h3><br /><p>The basic transform for a Complex Type in XSD follows these rules:</p><ol><br /><li>An OWL class is generated for a complex type.</li><br /><li>The URI of the class is generated in three different ways. If the complex type is global and named, then the <code>name</code> attribute is used. If the complex type is local and named, then the <code>name</code> attribute of the owner element is used. If the complex type is anonymous, then the names of its owner element and its parent element are used.</li><br /><li>The <code>xsd:annotation</code> and attribute annotations describing the complex type get generated as <code>dc:description</code>, <code>rdfs:comment</code> and/or <code>skos:definition</code> OWL annotations.</li><br /><li>Nested or reference children elements of the complex type become OWL allValuesFrom restrictions on the class. If the element has a simple type, then a restriction with an OWL datatype property and an XSD datatype range or a user-defined RDFS datatype range is generated. If the element has a complex type, then a restriction with an OWL object property and an OWL class range is generated. The <code>minOccurs</code> and <code>maxOccurs</code> values become OWL cardinality restrictions.</li><br /><li>Element group and attribute group references are generated as super classes.</li><br /><li>Attributes become restrictions with an OWL datatype property and an XSD datatype range or a user-defined RDFS datatype range.</li><br /></ol><p>An example of a Complex Type, <code>Trade</code>, in fpml-doc-5-2.xsd of transparency standard is displayed below:</p><br /><pre class="smallXmlBlock"><xsd:complexType name="Trade"><br /> <xsd:annotation><br /> <xsd:documentation xml:lang="en"><br /> A type defining an FpML trade.</xsd:documentation><br /> </xsd:annotation><br /> <xsd:sequence><br /> <xsd:element name="tradeHeader" type="TradeHeader"><br /> <xsd:annotation><br /> <xsd:documentation xml:lang="en"><br /> The information on the trade which is not <br /> product specific, e.g. trade date.<br /> </xsd:documentation><br /> </xsd:annotation><br /> </xsd:element><br /> <xsd:group ref="TradeEconomics.model"><br /> <xsd:annotation><br /> <xsd:documentation xml:lang="en"><br /> The economics of the trade. In the case of an <br /> OTC trade, this is the OTC derivative product.<br /> In the case of a trade of a security,<br /> it is the instrument trade economoics.<br /> </xsd:documentation><br /> </xsd:annotation><br /> </xsd:group><br /> </xsd:sequence><br /> <xsd:attribute name="id" type="xsd:ID" /><br /></xsd:complexType><br /></pre><p>The following is the graph of the OWL class generated for <code>Trade</code> complex type, which shows the OWL class, restrictions, annotations and superclass.</p><br /><a href="http://www.linkedmodels.org/images/xsd2owl/trade-graph.png" onclick="diagramPopUp(this.href); return false;"> <img src="http://www.linkedmodels.org/images/xsd2owl/trade-graph.png" alt="Trade Graph" class="center" width="600 px;" height="248 px;" /> </a><br /><p>The following class diagram shows a more sophisticated view of <code>Trade</code> and its related classes downstream in the generated ontology (click on the diagram to open a window with a bigger image).</p><br /><a href="http://www.linkedmodels.org/images/xsd2owl/trade-schema-example.png" onclick="diagramPopUp(this.href); return false;"> <img src="http://www.linkedmodels.org/images/xsd2owl/trade-schema-example.png" alt="Trade Class Diagram" class="center" width="600 px;" height="331 px;" /> </a><br /><p>The diagram highlights these advanced features in generation:</p><br /><ol style="list-style-type: decimal"><br /><li>A superclass relation exists between <code>Trade</code>, generated from an XSD complex type and <code>TradeEconomics.model</code>, generated from an XSD element group.</li><br /><li>In the XSD, <code>Swap</code> element has the substitutionGroup <code>Product</code> element. Thus, <code>A_Global-Swap</code> becomes a subclass of <code>A_Global-Product</code>. <code>A_Global-</code> prefix is used to distinguish the element-derived classes from similarly named complex-type-derived classes.</li><br /><li><code>dtype:value</code> restrictions are generated to hold the simple contents occuring in complex types. The complex content part of the type become other restrictions.</li><br /><li>The generated object properties have a <code>Ref</code> suffix to distinguish them from datatype properties with same names. Both types of properties can be used in restrictions on different classes as they may be generated from nested or reference children elements under different complex types.</li><br /></ol><p>The instance file, "msg_ex001_new_trade.xml" was imported into the transparency ontology. Here is a peek into that XML file:</p><br /><pre class="smallXmlBlock">...<br /><trade><br /><tradeHeader><br /> <partyTradeIdentifier><br /> <tradeId tradeIdScheme=<br /> "http://fpml.org/universal_swap_id">123</tradeId><br /> <tradeId tradeIdScheme=]<br /> "http://fpml.org/submitter_trade_id">456</tradeId><br /> </partyTradeIdentifier><br /> <tradeInformation><br /> ...<br /> <cleared>true</cleared><br /> <nonStandardTerms>false</nonStandardTerms><br /> <offMarketPrice>false</offMarketPrice><br /> <largeSizeTrade>false</largeSizeTrade><br /> ...<br /> </tradeInformation><br /> <tradeDate>2011-02-04</tradeDate><br /></tradeHeader><br /><swap><br /> <productType>InterestRateSwap</productType><br /> <assetClass>InterestRates</assetClass><br /> <swapStream><br /> ...<br /> </swapStream><br /> <swapStream><br /> ...<br /> </swapStream><br /></swap><br /></trade><br />...</pre><p>The above XML constructs were mapped into the following RDF graph, where you can see how the instances, their relationships and their types are generated with respect to the <code>Trade</code> class diagram (click on the graph to open up a window for a more detailed view).</p><br /><a href="http://www.linkedmodels.org/images/xsd2owl/trade-instance-example.png" onclick="diagramPopUp(this.href); return false;"> <img src="http://www.linkedmodels.org/images/xsd2owl/trade-instance-example.png" alt="Trade Instance Example" class="center" width="600 px;" height="340 px;" /> </a><br /><h3 id="another-example-of-transformation-rules"><a href="#TOC">Another example of transformation rules</a></h3><p>The basic transform for an Enumeration in XSD follows these rules:</p><ol><li>An OWL class is generated from an XSD simple type having XSD enumeration facets. The localname of the class has <code>Enum</code> suffix to distinguish it from classes generated with similar names.</li><br /><li>This class becomes a subclass of <code>EnumeratedValue</code> in the same namespace as the OWL class, which itself becomes a subclass of <code>dtype:EnumeratedValue</code>.</li><br /><li>Each XSD enumeration facet becomes an instance of the generated class. <code>dtype:value</code> holds the enumeration value. <code>dtype:order</code> is the order in which the enumeration facet occurs.</li><br /><li>An <code>Enumeration</code> class in the same namespace as the OWL class is also generated. This class becomes subclass of <code>dtype:Enumeration</code>. An instance of this class is generated as a container to refer to all the instances generated from the current simple type.</li><br /></ol><p>Enumerated value instance URIs are generated using a concatenation of the abbreviation of the class localname's upper case letters and the <code>dtype:value</code> literal.</p><p>The following figure shows a graph for <code>PremiumQuoteBasisEnum</code> class and the OWL constructs generated from the related XSD enumeration facets (click on the diagram to open a window with a bigger image):</p><a href="http://www.linkedmodels.org/images/xsd2owl/trade-enumeration-example.png" onclick="diagramPopUp(this.href); return false;"> <img src="http://www.linkedmodels.org/images/xsd2owl/trade-enumeration-example.png" alt="Trade Instance Example" class="center" width="600 px;" height="340 px;" /> </a><h3 id="complete-table-of-supported-transformations"><a href="#TOC">Complete table of supported transformations</a></h3><br /><p>For the reader interested in more details a full overview of the mapping transformations is given in the following table:</p><br /><table class="sample"><CAPTION><EM>Table: Conversion from XSD Constructs to OWL Constructs</EM></CAPTION><tr><th class="order">#</th><th class="xsd-constructs">XSD/XML Constructs</th><th class="owl-constructs">OWL Constructs</th></tr><tr><td>1</td><td><code>xsd:simpleType</code></td><td><code>owl:Datatype</code></td></tr><tr><td>2</td><td><code>xsd:simpleType</code> with <code>xsd:enumeration</code></td><td>Becomes an <code>owl:Class</code> as a subclass of <code>EnumeratedValue</code>. Instances are created for every enumerated value. An instance of <code>Enumeration</code>, referring to all the instances, is created as well as the <code>owl:oneOf</code> union over the instances.</td></tr><tr><td>3</td><td><code>xsd:complexType</code> over <code>xsd:complexContent</code></td><td><code>owl:Class</code></td></tr><tr><td>4</td><td><code>xsd:complexType</code> over <code>xsd:simpleContent</code></td><td><code>owl:Class</code></td></tr><tr><td>5</td><td><code>xsd:element</code> (global) with complex type</td><td><code>owl:Class</code> and subclass of the class generated from the referenced complex type</td></tr><tr><td>6</td><td><code>xsd:element</code> (global) with simple type</td><td><code>owl:Datatype</code></td></tr><tr><td>7</td><td><code>xsd:element</code> (local to a type)</td><td><code>owl:DatatypeProperty</code> or <code>owl:ObjectProperty</code> depending on the element type. OWL Restrictions are built for the occurrence.<br /></td></tr><tr><td>8</td><td><code>xsd:group</code></td><td><code>owl:Class</code> and subclass of <code>A_AbstractElementGroup</code></td></tr><tr><td>9</td><td><code>xsd:attributeGroup</code></td><td><code>owl:Class</code> and subclass of <code>A_AbstractAttributeGroup</code></td></tr><tr><td>10</td><td><code>xsd:minOccurs</code> and <code>xsd:maxOccurs</code></td><td>Cardinality specified in minimum cardinality, maximum cardinality and universal (allValuesFrom) OWL restrictions.</td></tr><tr><td>11</td><td>Anonymous Complex Type</td><td>As for Complex Type except a URI is constructed from the parent element and the nested element reference. Also, the class is defined as a subclass of <code>A_Anon</code>.<br /></td></tr><tr><td>12</td><td>Anonymous Simple Type</td><td>As for Simple Type except a URI is constructed from the parent element and the nested element reference.</td></tr><tr><td>13</td><td><code>xsd:default</code> on an attribute</td><td>Uses <code>dtype:defaultValue</code> to attach a value to the OWL restriction representing the associated property.</td></tr><tr><td>14</td><td>Substitution Groups</td><td>Subclass statements are generated for the members. Instance files resolve their types by consulting the OWL model at import-time.</td></tr><tr><td>15</td><td>Annotation attributes on elements</td><td>OWL Annotation properties are created and placed directly on the relevant class.</td></tr><tr><td>16</td><td>Annotations using <code>xsd:annotation</code></td><td>Become, based on user selection, <code>dc:description</code>, <code>rdfs:comment</code> and/or <code>skos:definition</code> OWL annotations.</td></tr><tr><td>17</td><td><code>xsi:type</code> on an XML element</td><td>Overrides the schema type with the specified type.</td></tr></table><h3 id="a-sparql-metric-query"><a href="#TOC">A SPARQL Metric Query</a></h3><p>As a quick check on the generated OWL models, the following is a useful SPARQL query that counts the number of properties on each OWL class.</p><br /><pre class="query"><br /><br /> SELECT ?class (COUNT(DISTINCT ?p) AS ?properties)<br /> WHERE {<br /> ?class a owl:Class .<br /> FILTER( afn:namespace( ?class ) = <br /> "http://www.fpml.org/FpML-5/transparency#") .<br /> OPTIONAL {<br /> ?class rdfs:subClassOf ?r .<br /> ?r a owl:Restriction .<br /> ?r owl:onProperty ?p .<br /> }<br /> }<br /> GROUP BY ?class<br /> ORDER BY DESC( ?properties )<br /><br /></pre><p>The classes for the transparency ontology have the distribution of properties shown in the following figure (click on the diagram to open a window with a bigger image). For example, <code>TradeInformation</code> has 12 properties:</p><br /><a href="http://www.linkedmodels.org/images/xsd2owl/transparency-classes-properties.png" onclick="diagramPopUp(this.href); return false;"> <img src="http://www.linkedmodels.org/images/xsd2owl/transparency-classes-properties.png" alt="FpML Example 2" class="center" width="600 px;" height="244 px;" /> </a><br /><h3 id="concluding-remarks"><a href="#TOC">Concluding remarks</a></h3><p>The new capability is easy to use. As before, a convenient import wizard will guide the user. The dialog has a number of new options. XML conversion will happen automatically when users open XML files in TBC or use XML import modules in SPARQLMotion. As long as an XML file is valid against an XSD that it is based on, the XML will be transformed in accordance to the schema. Parts of the XML files that do not validate against a schema will continue to be converted using the default Semantic XML structure. There is also a new option to specify which OWL file to use as a schema when mapping a specific XML file to triples. This feature is also available for spreadsheets and will be covered in a separate blog.</p><p>We believe that the importance of this work is not only in its value to harvest XML Schemas. Ability to use the automatic creation of triples from XML instance files directly in applications is proving to be key to a number of customers. For example, TopQuadrant is currently using this approach in a project for the North Sea Oil and Gas industry.</p><p>The functionality we have described will be released in TopBraid Composer 3.6.0. This release entered internal beta this week. Please contact us if you want a try these capabilities before general availability, which is currently planned for November.</p><br /></div>ralphtqhttp://www.blogger.com/profile/11340855777025790541noreply@blogger.com0tag:blogger.com,1999:blog-7507012841435012041.post-35126639537203214322011-07-21T15:25:00.000-07:002011-07-21T15:27:46.452-07:00Putting your drag-and-drop SPINMap vocabulary mappings into production<span class="Apple-style-span" style="font-family: arial, helvetica; font-size: 14px; "><p style="font-family: arial, helvetica; font-size: 10pt; ">The "Composing the Semantic Web" blog entry <a href="http://composing-the-semantic-web.blogspot.com/2011/04/spinmap-sparql-based-ontology-mapping.html">SPINMap: SPARQL-based Ontology Mapping with a Graphical Notation</a> describes TopBraid 3.5's new tool for mapping between vocabularies or ontologies. (It also points to a handy video that demonstrates both simple and sophisticated uses of SPINMap.) Once you've created a mapping, though, how do you use it to convert data? As it turns out, no new technology is necessary; SPINMap just creates <a href="http://www.w3.org/Submission/2011/02/">SPIN</a> rules that you can apply in a SPARQLMotion script.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">Let's look at an example. Imagine that I'm a publisher who receives images and metadata about those images from ExampleCo every month, and I load these images and metadata into my company's Digital Asset Management system. ExampleCo uses their own vocabulary to describe the metadata, but I prefer to use the <a href="http://nepomuk.semanticdesktop.org/">NEPOMUK</a> vocabulary for describing image metadata, because I know that by taking advantage of a vocabulary used by other systems around the world, my data can more easily interoperate with other data and tools.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">Following the steps described in the blog posting mentioned above, I create the mapping from ExampleCo's pd:Image class and its associated properties to the NEPOMUK equivalents. Because the NEPOMUK image vocabulary's nexif:Photo class has so many properties associated with it, the diagram of it doesn't all fit on the screen at once, but it was easy enough scroll up and down as I mapped the pd:Image properties on the left to various NEPOMUK nexif:Photo properties.</p><img src="http://www.snee.com/bobdc.blog/img/tq/usingmapping1.jpg" border="0" hspace="30px" vspace="30px" alt="Mapping from input to output with SPINMap" width="540" /><p style="font-family: arial, helvetica; font-size: 10pt; ">I saved the mapping in its own file, which I called ExampleCo2Nepomuk.ttl. At this point, I could convert a set of ExampleCo metadata by importing a file of that data and ExampleCo2Nepomuk.ttl into the same model and then picking <b>Run Inferences</b> from the <b>Inference</b> menu, assuming that <b>Configure Inferencing</b> on the same menu had TopSPIN configured as the inferencing engine.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">I wanted this to be more automated, though, so I put it in a SPARQLMotion script that could be called as a web service or from a TopBraid Ensemble interface. This would make it easier to re-use this mapping every month on each new batch of ExampleCo image data as it comes in:</p><img src="http://www.snee.com/bobdc.blog/img/tq/usingmapping2.jpg" border="0" hspace="30px" vspace="30px" alt="SPARQLMotion script that applies mappings" /><p style="font-family: arial, helvetica; font-size: 10pt; ">The script's first module prompts for the input filename, because it will be a new dataset each month. This module hands the filename to the "Get ExampleCo RDF" module, an Import RDF From Workspace module that reads in the ExampleCo data.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">At the same time, another Import RDF From Workspace module named "Get mapping rules" reads in the ExampleCo2Nepomuk.ttl file storing the SPIN-based mapping rules. Both of these modules feed their triples to an Apply TopSPIN module named "Apply mapping rules," which has its sml:replace value set to true so that it only passes along the new triples that it creates and not the input triples. The script's last module saves the result in a disk file, but could easily send it off for addition to a triplestore in a Digital Asset Management system.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">There's nothing especially new or unusual in this script; what's new is that the rules that it applies to the data were created by a graphical drag-and-drop tool instead of being coded by hand. (Rest assured that the rules stored by the tool are still expressed using standard SPARQL.) With easy data aggregation being one of the great advantages of semantic web applications, it's nice to know that SPINMap lets you define data transformations with less trouble than ever before, making your application development (and application maintenance) even faster.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">As an added bonus, because the mappings are stored as SPIN rules (also known as <a href="http://spinrdf.org/">SPARQL Rules</a>), they can easily be combined with other SPARQL Rules that you can run with the same script. These other rules might perform validation to ensure that the data being read conforms to certain data quality standards, or they could calculate new values based on a combination of the incoming data and existing stored data.</p></span>Bob DuCharmehttp://www.blogger.com/profile/02742075186312518829noreply@blogger.com1tag:blogger.com,1999:blog-7507012841435012041.post-77582930902105737852011-06-26T17:50:00.000-07:002011-06-26T18:46:50.404-07:00Comparing SPIN with RIFSince SPIN (SPARQL Inferencing Notation) aka SPARQL Rules became <a href="http://www.w3.org/Submission/2011/SUBM-spin-overview-20110222/">W3C member submission</a>,we find ourselves responding to the growing interest to it.<br /><br />With this, a question some may ask is how SPIN is different from or similar to <a href="http://www.w3.org/TR/2010/REC-rif-core-20100622/">RIF</a> - W3C's standard for rules interchange. <br /><br />While I have heard this asked a couple of times, I was pleasantly surprised that it was is not a very common question. Pleasantly, because a certain level of confusion is to be expected about new things and, both, SPIN and RIF are relatively new. If so few people ask this question, then SPIN specification did a good job explaining and positioning it and people easily grasp the unique and important needs it serves. Still, I thought it was worth while to write up my thoughts on comparing SPIN with RIF.<br /><br />The goal of RIF was to create an interchange format for use between rules engines. As such, unlike SPIN, RIF is not an idea that is specifically or particularly aligned with RDF. This is why RIF was created as XML (although there is now work on RDF serialization). I am not pointing this out as a shortcoming of RIF, but rather to put in perspective the origin and the reason for RIF. In its goals, RIF is similar to OMG's XMI which also uses XML and was created to be an interchange format between different tools.<br /> <br />Given this similarity, XMI’s failure in being a reliable interchange format becomes relevant when considering RIF's future. Will RIF succeed in reaching its goal? One can easily argue that with the variety of available rules languages and engines, RIF’s job is harder than what XMI needed to do to succeed.<br /> <br />As noted <a href="http://www.w3.org/2005/rules/wiki/RIF_FAQ#What_is_RIF.3F">here</a>, different rules languages exist because there are different algorithms and formalisms for rules. Furthermore, different rule products have different sets of capabilities. RIF dialects are intended to be the least common denominators for a given type of a rule engine. This means that in order to effectively use the same set of RIF rules in the ‘rules engine A’ and in the ‘rules engine B’, the following needs to happen:<br /> <br /><span style="font-weight:bold;">1. RIF dialect used to express the rules, needs to be supported by both rules engines.</span><br /><br />Checking the <a href="http://www.w3.org/2005/rules/wiki/Implementations">implementation page</a>, one will see that currently the overlap between any two engines is not that great. Some support BLD, some support PRD + Core, others support BLD partial or PRD minus something, etc.<br /><span style="font-weight:bold;"><br /><br />2. RIF dialect used to express the rules, must be enough for the task at hand.</span><br /><br />As mentioned above, RIF by design is somewhat of a least common denominator. This means that a user could always do more with a given rules engine than they can express in a dialect of RIF. <br /><br />For example (as noted <a href="http://www.w3.org/2005/rules/wiki/RIF_FAQ#I.27d_like_to_know_if_it.27s_possible_to_translate_RIF_into_SPARQL_Construct_clause_.28and_back.29">here</a>), SPARQL is more expressive than what is possible with RIF. This is not unique to SPARQL, it is true for pretty much any rules technology. <br /><br /><span style="font-weight:bold;">3. The interchange must work</span><br /><br />Given well known XMI issues, I am quite keen to see RIF test cases as well as test case results from the implementers<br /> <br />Attitude of the major rule engine vendors towards RIF is currently, at best, lukewarm. For example, on <a href="http://forums.oracle.com/forums/thread.jspa?threadID=2145544&tstart=165">the Oracle forum</a>, support engineers recommend against attempting to interchange rules by saying:<br /> <br /><span style="font-style:italic;">“In a hybrid environment I'd recommend that rules authored in ILOG be executed in the ILOG engine, and that rules authored in OPA be executed in the OPA engine, rather than attempt to interchange rules between the two products. As long as there is a clear scope boundary between what the rule sets are used for, then there wouldn't be any duplication or interchange of rules.”</span><br /> <br />Having considered the design goals and challenges of RIF, it is easy to see that the design goals of SPIN are quite different. SPIN is not about capturing rules that can then be translated for execution by different types of rule engines. Rather it is about capturing rules that can be executed directly over RDF data and about having rules that are intimately connected to the Semantic Web models. <br /><br />With these goals in mind, we identified the following three things as important principles in SPIN's design:<br /> <br />1. <span style="font-weight:bold;">Rules can be expressed in a familiar language.</span> People working with RDF must know SPARQL. Using SPARQL for rules means that they don’t need to use another language<br /><br />2. <span style="font-weight:bold;">Rules can be executed by any RDF database.</span> Since they are in SPARQL, rules are portable – not across rules engines, but across RDF stores<br /><br />3. <span style="font-weight:bold;">Evolution of the models does not unnecessarily break the rules.</span> For example, let’s say we change the URI of a resource used in a rule. If a rule uses some other format (XML) and is not connected to the underlying RDF in a way other than a blob, it becomes hard to maintain these two different sets of information<br /> <br />Finally, SPIN takes an object-oriented approach to rules. It is about programming and about associating behavior with classes while RIF takes a model-theoretic view on how the rules may relate to ontologies. This is a key difference as noted in <a href="http://www.w3.org/Submission/2011/02/Comment/">W3C comments on SPIN submission</a>. <br /><br />In short, SPIN and RIF address different needs and have different design goals. They can be considered complimentary. <br /><br />What about using SPIN and RIF together? Given the key role SPARQL plays in the architecture of Semantic Web solutions, I am certain that should RIF get traction in its adoption, someone will create a RIF profile for SPARQL and write a RIF to SPARQL translation.Irene Polikoffhttp://www.blogger.com/profile/17834271916697741738noreply@blogger.com0tag:blogger.com,1999:blog-7507012841435012041.post-23150344391914618352011-03-30T07:04:00.000-07:002012-04-14T11:57:53.790-07:00How to: extend an ontology<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;"></span><br />
<div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">When people work with ontologies, XML schemas and software development, it's almost a cliché to say that re-use of existing work is better than creating something new from scratch. Existing work, though, is not always a perfect fit to your needs, and the ease of customizing it for your needs often depends a lot on how the original work was designed—when you're reusing XML schemas or software source code. Customizing OWL ontologies and RDF schemas, on the other hand, is pretty simple nearly all of the time, especially when you use TopBraid Composer.</span></div>
<div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">For example, let's say that you have a taxonomy of business terms to track, and the W3C's <a href="http://www.w3.org/2004/02/skos/">SKOS</a> standard defines all the properties you need to maintain metadata about these terms, with two exceptions: SKOS has nothing about the last person to edit a term and it has no slot for the editor's department code, which is a special bit of metadata within your enterprise. Customizing SKOS to include these is just two steps:</span></div>
<ol>
<li style="font-family: arial, helvetica; font-size: 10pt;"><div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">Create an empty new ontology and import SKOS into it.</span></div>
</li>
<li style="font-family: arial, helvetica; font-size: 10pt;"><div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">Define your two properties in this new ontology and give them a domain of <tt>skos:Concept</tt> so that SKOS tools such as TopBraid <a href="http://www.topquadrant.com/solutions/ent_vocab_net.html">Enterprise Vocabulary Net</a>(EVN) know that they're potential properties of your SKOS concepts.</span></div>
</li>
</ol>
<div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">To do this with TopBraid Composer, start by creating a new RDF/OWL file in one of your projects. On the wizard dialog box for creating this file, enter the Base URI of your new customized version of the SKOS ontology. If I worked for The Example Company, I might create a baseURI of http://example.com/ns/exskos.</span></div>
<div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">On the same dialog box, click the checkbox next to SKOS under "Initial imports" and click <b>Finish</b>. (If you forget to click the checkbox first, you can always drag the skos-core.rdf file from the Navigator View's /TopBraid/SKOS folder to the <b>Imports</b> tab. In fact, to start creating a customized version of any ontology, drag a copy of it into your custom ontology's <b>Imports</b> tab.)</span></div>
<div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">Once the file is created, having a namespace prefix associated with the base URI makes it easier to create the new properties, so on your new ontology's <b>Overview </b>tab add an <tt>ex</tt> prefix for the http://example.com/ns/exskos# namespace. Don't forget the pound sign; the prefix will be standing in for this URI, and you want<tt>ex:editor</tt> to represent http://example.com/ns/exskos#editor, not http://example.com/ns/exskoseditor.</span></div>
<div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">Now we're ready to add the customizations. Instead of creating a new <tt>editor</tt> property from scratch, it's better to define it as a subproperty of the Dublin Core<tt> dc:creator</tt> property so that applications that don't know about our new property but do know about Dublin Core properties will have some clue what it's for.</span></div>
<ol>
<li style="font-family: arial, helvetica; font-size: 10pt;"><div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">Drag the dc1-1.rdf Dublin Core ontology file from the /TopBraid/Common folder in TopBraid Composer's Navigator view to the <b>Imports</b> tab to import the Dublin Core ontology. You'll see several new properties will join the SKOS ones on the <b>Properties</b> view.</span></div>
</li>
<li style="font-family: arial, helvetica; font-size: 10pt;"><div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">Right-click on <tt>dc:creator</tt> there and pick <b>Create subproperty</b>. In the <b>Create subproperty</b> wizard, replace the dc:Property_1 value that appears as the default <b>Name of new instance</b> value with ex:editor, which uses the ex prefix that you defined earlier.</span></div>
</li>
<li style="font-family: arial, helvetica; font-size: 10pt;"><div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">Click the checkbox next to rdfs:label on the dialog box's <b>Annotations Template</b> so that an rdfs:label property gets automatically set for this property. (One nice thing about how the RDF data model lets you assign properties to properties is that you can associate human readable names to substitute for the actual property names on forms and reports.)</span></div>
</li>
<li style="font-family: arial, helvetica; font-size: 10pt;"><div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">Click the <b>OK</b> button and you'll see a property form in the middle of your screen for your new property, which will be selected in the <b>Properties</b> view. (It's on the left of the screenshot below because the <b>Classes</b> view is not shown there.)</span></div>
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;"><img src="http://www.snee.com/bobdc.blog/img/tq/extendont1.jpg" width="540" /></span></li>
<li style="font-family: arial, helvetica; font-size: 10pt;"><div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">To show that your ontology is defining this new property for SKOS concepts, click the small white triangle next to the word <b>domain</b> on the ex:editor property form and pick <b>Add existing</b> to indicate that this property's domain will be an existing class. Click skos:Concept, which will be under owl:Thing on the wizard's class tree, and click <b>OK</b>.</span></div>
</li>
</ol>
<div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">You're finished defining your editor property. The department code one will be even quicker to create, because it won't be a subproperty of something else:</span></div>
<ol>
<li style="font-family: arial, helvetica; font-size: 10pt;"><div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">Click the <b>Properties</b> view's small white triangle to display its menu and pick <b>Create rdf:Property</b>. Name the new property ex:deptCode on the <b>Create Property</b> wizard dialog box. The Annotations Template's rdfs:label checkbox should already be checked, so click <b>OK</b>.</span></div>
</li>
<li style="font-family: arial, helvetica; font-size: 10pt;"><div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">Set your newest property's domain to skos:Concept the same way you did for ex:editor and save your file.</span></div>
</li>
</ol>
<div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">You're done! You know have a customized version of the SKOS ontology. If you now use TopBraid Composer or EVN to create a new instance of the Concept class in this file, you would see <b>editor</b> and <b>dept code</b> fields on your new concept's resource form along with <b>has broader</b> and all the other standard SKOS properties. (If you create concept instances with TopBraid Composer and the labels are toggled to show qnames instead of human-readable labels, they'll say <b>ex:editor</b> and<b>ex:deptCode</b>.) Instead of creating concept instances in this file, though, you would more likely create a new taxonomy file that imports your customized ontology the same way that your ontology imported the SKOS and Dublin Core ontologies, and then you would store your taxonomy's concepts in this new file.</span></div>
<div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">The modularity of this approach brings another benefit that isn't as easy when customizing typical XML schemas and other software resource files: when a SKOS upgrade is released, you can simply delete the import of the current SKOS ontology in your customization of it and import the new one instead, and all of your applications that use your custom ontology should be able to go on using it the same way the did before.</span></div>
<div style="font-family: arial, helvetica; font-size: 10pt;">
<span class="Apple-style-span" style="font-family: arial,helvetica; font-size: 14px;">It's nice to know that customization of a standard ontology that nearly meets your needs is so easy, and many organizations are doing this with the SKOS ontology to create a better fit with their vocabulary management requirements. This isn't limited to customizing SKOS, though; the same principle works with any OWL ontology or RDF schema. As an added benefit, if you create a customized version of a particular standard for your enterprise, you can follow these same steps to create customizations of your customization for individual departments within your enterprise.</span></div>Bob DuCharmehttp://www.blogger.com/profile/02742075186312518829noreply@blogger.com1tag:blogger.com,1999:blog-7507012841435012041.post-51363638619627404222011-02-03T17:12:00.000-08:002011-09-21T21:50:58.188-07:00Converting UML Models to OWL - Part 1: The Approach<div><script type="text/javascript">var newwindow; function diagramPopUp(url){ newwindow=window.open(url,'name','height=600,width=1000,left=50,top=50,resizable=yes,scrollbars=yes,toolbar=no,status=yes'); if (window.focus) {newwindow.focus()}}</script> <style type="text/css"><!-- pre.xmlBlock { font-size:1.20em; background-color:#CCFFFF; border:#999999 2px solid ; display: block; margin-left: auto; margin-right: auto; } pre.smallXmlBlock { font-size:1.0em; background-color:#CCFFFF; border:#999999 2px solid ; display: block; margin-left: auto; margin-right: auto; } pre.turtleBlock { font-size:1.20em; background-color:#CCFFFF; border:#999999 2px solid ; display: block; margin-left: auto; margin-right: auto; } pre.spinBlock { font-size:1.1em; background-color:#CCFFFF; border:#999999 2px solid ; display: block; margin-left: auto; margin-right: auto; } img.center { display: block; margin-left: auto; margin-right: auto; } p.caption { display: block; font-size: 22 px; line-height: 17px; margin-left: auto; margin-right: auto; margin: 10px; padding-top: 4px; text-align: center; font-weight: bold; white-space: nowrap; color: black; } code.rdfStatement { display: inline; font-size: 16 px; background-color:#CCFFFF; border:#999999 1px solid ;} div.sparqlDetails { border: 2px dotted; } p.sparqlDetails { padding-top: 2px; padding-bottom: 2px; padding-right: 5px; padding-left: 35px; text-indent: -30px; } div.indentedSparqlDetails { padding-top: 2px; padding-bottom: 2px; padding-right: 25px; padding-left: 35px; } --></style><br /><p>Convert UML to OWL - why would you ever want to do this? One reason suffices: many enterprise models, that serve as either standards or enterprise schemas, are specified in UML. Increasingly, there is interest in having content of UML models re-purposed in RDF/OWL and the need for RDF/OWL to interoperate with systems built from UML Models.<br /></p><p>UML Models are notoriously hard to exchange between UML tools, let alone be transformed into OWL. The exchange format <a href="http://www.omg.org/technology/documents/modeling_spec_catalog.htm#XMI">XMI</a> is not only is difficult to understand but also has vendor-specific extensions. The vagaries of <a href="http://www.omg.org/mof/">MOF</a>, <a href="http://en.wikipedia.org/wiki/Meta-Object_Facility">CMOF</a><a> and </a><a href="http://en.wikipedia.org/wiki/Meta-Object_Facility">EMOF</a> create their own challenges. Nonetheless we have done transformations of UML to OWL. Using a model-based transformation approach, based on <a href="http://www.topquadrant.com/products/SPIN.html">SPARQL Rules</a>, XMI models of UML models can be converted to OWL. UML class diagrams can be represented in OWL without information loss. The inverse, however, is not true and will require another blog series.<br /></p><h3 id="contents">UML to OWL - Part 1 Contents</h3>Part 1 of the series explains the basis of the approach. The complete series of blogs, as currently conceived, is as follows:<br /><ul><li>Converting UML Models to OWL - Part 1: The Approach<br /></li><li>Converting UML Models to OWL - Part 2: Transforming UML Models to OWL Using SPARQL<br /></li><li>Converting UML Models to OWL - Part 3: Examples of Industry UML Model Transformations</li></ul>The content of this blog is organized as follows:<br /><ol><li><a href="#goals">Goals, Objectives and Requirements</a><br /></li><li><a href="#backgrounderXMI">Backgrounder on XMI</a><br /></li><li><a href="#backgrounderMOF">Backgrounder on MOF</a><br /></li><li><a href="#solution">Solution Outline</a><br /></li><li><a href="#overviewOfSXML">Overview of Semantic XML</a><br /></li><li><a href="#ocmof">OCMOF - the OWL Representation of CMOF</a><br /></li><li><a href="#howItWorks">How the Transformations from UML to OWL Work</a><br /></li><li><a href="#generationOfUMLMetaClasses">Generation of UML Metaclasses</a><br /></li><li><a href="#generationOfUMLClasses">Generation of UML Classes</a><br /></li><li><a href="#generationOfUMLSubClassOfs">Generation of UML Class Superclass Relationships</a><br /></li><li><a href="#generationOfUMLPackages">Generation of UML Packages</a><br /></li><li><a href="#generationOfUMLPackageRelationships">Generation of UML Package Relationships</a><br /></li><li><a href="#performance">Performance</a><br /></li><li><a href="#conclusion">Concluding Remarks</a></li></ol>Readers who are very interested in the detailed technical approach, should read all sections of this blog in order. Those who just need to have an overview of the approach could skip sections 9 through 12. Those who have deep knowledge of XMI and MOF may want to skip sections 2 and 3, but I would welcome their feedback on the accuracy of my statements.<br /><p>Note that some diagrams may be too small to be viewed in the body of the document. Clicking on such a diagram will open a new window with a larger depiction of the diagram.</p><h3 id="goals">Goals, Objectives and Requirements</h3>The OWL Models must faithfully represent packages and the logical models or class diagrams. Out of scope, currently, are all of the other UML models such as Interaction Diagrams and State Diagrams. The approach must be able to convert UML by processing XMI files from specific tools. This requires a strategy for converting from the XML structures of XMI to OWL models.<br /><h3 id="backgrounderXMI">Backgrounder on XMI</h3>XMI, the <a href="http://www.omg.org/technology/documents/modeling_spec_catalog.htm#XMI"><em>XML Metadata Interchange</em></a><em></em> standard is a serialization format for UML Models. The main purpose of XMI is to define how the XML elements are organized within an XMI file. The XMI spec also defines a mechanism for how one XMI element references another, within and across XMI files. Such a mechanism is needed as it is a legal scenario for a single UML model to be serialized to more than one XMI file.<br /><div><a href="#contents"><img src="http://www.linkedmodels.org/images/uml2owl/up_arrow.jpg" width="15" height="15" />Top</a></div><br /><h3 id="backgrounderMOF">Backgrounder on MOF</h3>MOF began at the time of <a href="http://www.omg.org/technology/documents/corba_spec_catalog.htm">CORBA</a> and the need for IDL interfaces. MOF 1.4 resulted in its mapping to Java being codified in the <a href="http://jcp.org/en/home/index">Java Community Process (JCP)</a> as the <a href="http://java.sun.com/products/jmi/">Java Metadata Initiative (JMI)</a>. MOF 2.0 was developed in tandem with UML 2.0. The separation of MOF into EMOF and CMOF was motivated by the influence of EMF's Ecore, and model-driven Java development. CMOF was more the motivation of meta model developers. CMOF stands for <em>Complete Meta Object Facility</em> and is an OMG standard for the UML 2 model interchange. More information can be found at <a href="http://www.omg.org/spec/UML/2.3/"><b>this page</b></a> on the <a href="http://www.omg.org/">OMG</a> Website.<br /><p>CMOF includes fully fledged associations, association generalization, property subsetting and redefinition, derived unions, and package merge. Typical XMI container structures look like the example below, from the CMOF UML Infrastructure Model. The basic idea is that a <code>packagedElement</code> owns other elements. A <code>type</code> attribute specifies the type of the <code>packagedElement</code>.<br />Things get a little busy with how IDs are used for associations and their member ends. That complication, we can leave for Part 2.</p><br /><pre class="smallXmlBlock"><?xml version="1.0" encoding="UTF-8"?><br /> <xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"<br /> xmlns:cmof="http://schema.omg.org/spec/MOF/2.0/cmof.xml"><br /> <cmof:Package xmi:id="_0" name="InfrastructureLibrary"><br /> <ownedMember xmi:type="cmof:Package" xmi:id="Core" name="Core"><br /> <ownedMember xmi:type="cmof:Package"<br /> xmi:id="Core-Abstractions" name="Abstractions"><br /> <packageImport xmi:type="cmof:packageImport"<br /> xmi:id="Core-Abstractions-_packageImport.0"<br /> importedPackage="Core-PrimitiveTypes"<br /> importingNamespace="Core-Abstractions"/><br /> <ownedMember xmi:type="cmof:Package"<br /> xmi:id="Core-Abstractions-Ownerships" name="Ownerships"><br /> <packageImport xmi:type="cmof:packageImport"<br /> xmi:id="Core-Abstractions-Ownerships-_packageImport.0"<br /> importedPackage="Core-Abstractions-Elements"<br /> importingNamespace="Core-Abstractions-Ownerships"/><br /> <ownedMember xmi:type="cmof:Class"<br /> xmi:id="Core-Abstractions-Ownerships-Element" name="Element" isAbstract="true"><br /> <ownedComment xmi:type="cmof:Comment"<br /> xmi:id="Core-Abstractions-Ownerships-Element-_ownedComment.0"<br /> annotatedElement="Core-Abstractions-Ownerships-Element"><br /> <body>An element is a constituent of a model.<br /> As such, it has the capability of owning other elements.</body><br /> </ownedComment><br /> <ownedRule xmi:type="cmof:Constraint"<br /> xmi:id="Core-Abstractions-Ownerships-Element-not_own_self"<br /> name="not_own_self" constrainedElement="Core-Abstractions-Ownerships-Element"<br /> namespace="Core-Abstractions-Ownerships-Element"><br /> <ownedComment xmi:type="cmof:Comment"<br /> xmi:id="Core-Abstractions-Ownerships-Element-not_own_self-_ownedComment.0"<br /> annotatedElement="Core-Abstractions-Ownerships-Element-not_own_self"><br /> <body>An element may not directly or indirectly own itself.</body><br /> </ownedComment><br /> <specification xmi:type="cmof:OpaqueExpression"<br /> xmi:id="Core-Abstractions-Ownerships-Element-not_own_self-_specification"><br /> <language>OCL</language><br /> <body>not self.allownedElements()->includes(self)</body><br /> </specification><br /> </ownedRule><br /> ...<br /> <ownedAttribute xmi:type="cmof:Property"<br /> xmi:id="Core-Abstractions-Ownerships-Element-ownedElement"<br /> name="ownedElement" type="Core-Abstractions-Ownerships-Element"<br /> upper="*" lower="0" isReadOnly="true" isDerived="true"<br /> isDerivedUnion="true" isComposite="true"<br /> association="Core-Abstractions-Ownerships-A_ownedElement_owner"><br /> <ownedComment xmi:type="cmof:Comment"<br /> xmi:id="Core-Abstractions-Ownerships-Element-ownedElement-_ownedComment.0"<br /> annotatedElement="Core-Abstractions-Ownerships-Element-ownedElement"><br /> <body>The Elements owned by this element.</body><br /> </ownedComment><br /> </ownedAttribute><br /> ...<br /></pre><p class="caption">Figure 1: A sample of XMI</p><br /><p>For more background on the history of MOF the following references may be of value: <a href="http://www.moflon.org/background/history/">MOFLON</a>, and <a href="http://en.wikipedia.org/wiki/Unified_Modeling_Language">Wikipedia</a>.</p><a href="#contents"><img src="http://www.linkedmodels.org/images/uml2owl/up_arrow.jpg" width="15" height="15" />Top</a><br /><h3 id="solution">Solution Outline</h3>Model-based transformation is the central idea of the approach. To implement it we have developed a metamodel of CMOF in OWL. Our strategy is to get out of XML into RDF Triples as soon as possible. Using an ontology of XML we convert XMI into a composite model of triples. XML is a simple enough structure for the composite object pattern - elements contain elements and elements have attributes. XML elements and attributes that make up the XMI file are transformed into OWL instances of the CMOF metamodel. Once we have the XMI in triples we can map constructs to classes and properties of a CMOF metamodel. This model then serves as the generator for model-based transformations to an OWL model of the UML.<br /><p>Once these instances are loaded as "raw" RDF, rules fire to perform the transformations. Rules are associated with classes to ensure that instances of those classes are processed in an execution sequence. Using <a href="http://www.topquadrant.com/products/SPIN.html">SPARQL Rules (SPIN)</a>, instances of a class are each processed through a binding mechanism specified by <code>?this</code> variable. SPARQL Rules can be considered an approach that is similar to, or can be compared with, UML's <a href="http://www.omg.org/spec/OCL/2.0/">Object Constraint Language (OCL)</a> and the <a href="http://www.omg.org/spec/QVT/">Query/View/Transformation (QVT)</a> approach to transformations.</p>The benefits of the OWL and SPARQLRules model-based approach to transformation are:<br /><ul><li>Intimacy of the rules with RDF/OWL - triples are evaluated directly<br /></li><li>Understandability - rules are smaller and expressed in the relevant contexts of the model<br /></li><li>Enhanced Performance - evaluation of rules is localized to relevant instances<br /></li><li>Customizability and Evolvability – transformations can be changed by modifying models and/or SPARQL rules<br /></li><li>Ease of maintenance - rules are associated with the constructs they operate over</li></ul><a href="#contents"><img src="http://www.linkedmodels.org/images/uml2owl/up_arrow.jpg" width="15" height="15" />Top</a><br /><h3 id="overviewOfSXML">Overview of Semantic XML</h3>XMI is imported into the CMOF metamodel using TopBraid Composer's <a href="http://composing-the-semantic-web.blogspot.com/2007/11/xmap-mapping-arbitrary-xml-documents-to.html">Semantic XML</a> as a mapping method. With Semantic XML, TopBraid can automatically generate an OWL/RDF ontology from any XML file. Each distinct XML element name is mapped into a class, and the elements themselves become instances of those classes. A datatype property is generated for each attribute. Nesting of XML elements is represented in OWL using a <code>composite:child</code> property - an object pattern in OWL that is described at <a href="http://composing-the-semantic-web.blogspot.com/2007/07/composite-design-pattern-in-rdfowl.html">this blog entry</a>.<br /><p>The key idea of Semantic XML is that each of the generated OWL classes and datatype properties is annotated with an annotation property, <code>sxml:element</code> and <code>sxml:attribute</code>, respectively. These properties relate the OWL concepts to the XML serialization. Note that these annotations are also used if an OWL model needs to be serialized back to XML format.</p>If you import an XML file into an ontology that already contains classes and properties with Semantic XML annotations, then the loader will reuse those. The mapping is bi-directional and loss-less so that files can be loaded, manipulated and saved without losing structural information.<br /><p></p>A video explaining how Semantic XML works is available at <a href="http://www.topbraidcomposer.com/videos/tutorials/xmap/XMap-TopBraid.wmv">this link</a>.<br /><div><a href="#contents"><img src="http://www.linkedmodels.org/images/uml2owl/up_arrow.jpg" width="15" height="15" />Top</a><br /></div><br /><h3 id="ocmof">OCMOF - the OWL Representation of CMOF</h3>The strategy for the transformation can be summarized as follows:<br /><ul><li>Use OWL classes to represent XMI Element Types<br /></li><li>Use SPARQL Rules on those classes to generate CMOF Metaclasses<br /></li><li>Use Metaclasses to make OWL Classes that represent the UML Model<br /></li></ul>An OWL metamodel of CMOF represents the kinds of containers, elements and attributes shown above. The metamodel was built by studying the UML Metamodel of UML 2.0 - the original motivation for this was to have an automated way of dealing with changes to UML. That will be a future consideration, for now this has proven to be a valuable way of doing verification and validation. The UML metamodel will be covered in Part 2 of this blog series, for Part 1, it is instructive perhaps to show a small piece of the XMI. Below is the XMI for <code>Basic-Property</code> from the UML model <code>infrastructure.cmof.xmi</code>.<br /><pre class="xmlBlock"><ownedAttribute xmi:type="cmof:Property"<br /> xmi:id="Core-Basic-Class-ownedAttribute" name="ownedAttribute"<br /> type="Core-Basic-Property" isOrdered="true"<br /> upper="*" lower="0" isComposite="true"<br /> association="Core-Basic-A_ownedAttribute_class"><br /> <ownedComment xmi:type="cmof:Comment"<br /> xmi:id="Core-Basic-Class-ownedAttribute-_ownedComment.0"<br /> annotatedElement="Core-Basic-Class-ownedAttribute"><br /> <body>The attributes owned by a class.<br /> These do not include the inherited attributes.<br /> Attributes are represented by instances of Property.</body><br /> </ownedComment><br /> </ownedAttribute><br /></pre><p class="caption">Figure 2: A fragment of the XMI for the UML metamodel</p><br /><p>As a example of XMI element mappings, the <code>sxml:element</code> maps the XMI element for <code>ocmof:ownedAttribute</code> as shown in the <a href="http://www.dajobe.org/2004/01/turtle/2007-09-11/">Turtle</a> extract from the OWL model below.</p><br /><pre class="turtleBlock">ocmof:ownedAttribute<br /> a owl:Class ;<br /> rdfs:label "Attribute"^^xsd:string ;<br /> rdfs:subClassOf ocmof:TypedThing , ocmof:NamedThing ;<br /> rdfs:subClassOf<br /> [ a owl:Restriction ;<br /> owl:maxCardinality "1"^^xsd:nonNegativeInteger ;<br /> owl:onProperty ocmof:isComposite<br /> ] ;<br /> rdfs:subClassOf<br /> [ a owl:Restriction ;<br /> owl:maxCardinality "1"^^xsd:nonNegativeInteger ;<br /> owl:onProperty ocmof:type<br /> ] ;<br /> rdfs:subClassOf<br /> [ a owl:Restriction ;<br /> owl:maxCardinality "1"^^xsd:nonNegativeInteger ;<br /> owl:onProperty ocmof:isDerivedUnion<br /> ] ;<br /> rdfs:subClassOf<br /> [ a owl:Restriction ;<br /> owl:maxCardinality "1"^^xsd:nonNegativeInteger ;<br /> owl:onProperty ocmof:isReadOnly<br /> ] ;<br /> rdfs:subClassOf<br /> [ a owl:Restriction ;<br /> owl:maxCardinality "1"^^xsd:nonNegativeInteger ;<br /> owl:onProperty ocmof:default<br /> ] ;<br /> sxml:element "ownedAttribute"^^xsd:string .<br /></pre><p class="caption">Figure 3: ocmof:ownedAttribute in Turtle</p>The last line, <code class="rdfStatement">sxml:element "ownedAttribute"^^xsd:string</code>, is the mapping.<br /><p>As a example of XMI attribute mappings, the <code>sxml:attribute</code> maps the XMI attribute for <code>ocmof:isOrdered</code> as shown in the <a href="http://www.dajobe.org/2004/01/turtle/2007-09-11/">Turtle</a> extract from the OWL model below.<br /></p><br /><pre class="turtleBlock">ocmof:isOrdered<br /> a owl:DatatypeProperty ;<br /> rdfs:domain ocmof:ownedAttribute ,<br /> ocmof:ownedParameter ,<br /> ocmof:OwnedEnd ;<br /> rdfs:label "is ordered"^^xsd:string ;<br /> rdfs:range xsd:boolean ;<br /> sxml:attribute "isOrdered"^^xsd:string .<br /></pre><p class="caption"></p><p class="caption">Figure 4: ocmof:isOrdered in Turtle</p>The last line, <code class="rdfStatement">sxml:attribute "isOrdered"^^xsd:string</code>, is the mapping.<br /><p>The transformation to OWL results in the following class for <code>uml:Core-Basic-Property</code>.<br />Clicking on the image will open a larger image in a new window.<br /></p><a href="http://www.linkedmodels.org/images/uml2owl/core-basic-element.png" onclick="diagramPopUp(this.href); return false;"><img src="http://www.linkedmodels.org/images/uml2owl/core-basic-element.png" alt="Core-Basic-Property Classes" class="center" width="590 px;" height="156 px;" /><p class="caption">Figure 5: A Generated Metaclass Example - uml:Core-Basic-Property</p></a>The diagram shows how the datatype properties of the class <code>uml:Core-Basic-Property</code> correspond to the XMI attributes given in the above fragment. For example <code>isComposite</code> becomes the property <code>hasBooleanIsComposite</code>. The prefix <code>hasBoolean</code><span style="font-family:monospace;"> </span>is customizable.<br /><p>First an OWL model of CMOF XML Elements is used to generate instances of metaclasses to build OWL Classes for XMI Elements. The namespace prefix of <code>ocmof</code> has been used to denote all modeling constructs that makeup the CMOF metamodel. The prefix <code>cmof</code> is the namespace for all constructs generated from the import of the XMI files. </p><p>In the diagram below, we show the main classes of the metamodel. Classes like <code>NamedThing</code> and <code>TypedThing</code> have been introduced to optimize the work of the transformers. Constructs in XMI can typically be both named and typed. This kind of multiple inheritance is no problem for the transformations. The diagram is a partial view only. Clicking on the image will open a larger image in a new window.</p><a href="http://www.linkedmodels.org/images/uml2owl/ocmof-classes.png" onclick="diagramPopUp(this.href); return false;"><br /><img src="http://www.linkedmodels.org/images/uml2owl/ocmof-classes.png" alt="OCMOF Classes" class="center" width="590 px;" height="224 px;" /><p class="caption">Figure 6: Some of the classes of the CMOF OWL model</p></a>As an alternate view, the diagram that follows is an HTML report of NamedThing in TopBraid Composer. This is automatically generated using SPARQL Web Pages (aka <a href="http://uispin.org/">UISPIN</a>)<br /><a href="http://www.linkedmodels.org/images/uml2owl/namedThing-summary.png" onclick="diagramPopUp(this.href); return false;"><br /><img src="http://www.linkedmodels.org/images/uml2owl/namedThing-summary.png" alt="NamedThing Summary generated by UISPIN" class="center" width="365 px;" height="451 px;" /><p class="caption">Figure 7: OCMOF NamedThing - an abstract class for the transformations</p></a>The diagram below shows more details of some <code>ownedElements</code>. Note how attributes of each of these classes relate to CMOF constructs.<br /><a href="http://www.linkedmodels.org/images/uml2owl/ownedElements.png" onclick="diagramPopUp(this.href); return false;"><br /><img src="http://www.linkedmodels.org/images/uml2owl/ownedElements.png" alt="Owned Elements" class="center" width="590 px;" height="224 px;" /><p class="caption">Figure 8: Some "ownedElement" OWL Classes in the OCMOF model</p></a>These ocmof classes serve as the starting point for generating ocmof meta-classes and instances of these classes that become the UML model transformed into OWL. The figure below shows the main metaclasses that are generated by rules on the ocmof classes.<br /><a href="http://www.linkedmodels.org/images/uml2owl/cmof-metaclass.png" onclick="diagramPopUp(this.href); return false;"><br /><img src="http://www.linkedmodels.org/images/uml2owl/cmof-metaclass.png" alt="CMOF Metaclasses" class="center" width="590 px;" height="346 px;" /><p class="caption">Figure 9: The key Meta-classes of the CMOF OWL model</p></a><br /><div><a href="#contents"><img src="http://www.linkedmodels.org/images/uml2owl/up_arrow.jpg" width="15" height="15" />Top</a></div><br /><h3 id="howItWorks">How the Transformations from UML to OWL Work</h3>Model-based transformations use rules associated with OWL Classes. OWL Metaclasses are built using a SPARQL rule for instances of <code>TypedThing</code>. The names of the metaclasses are determined from the value of the <code>xmi:type</code> attribute. A number of SPARQL Rules are defined on <code>TypeThing</code>. Priorities are set by the alphabetic ordering given by the first comment line of the rule. These rules look after the generation of:<br /><ol><li>UML Metaclasses<br /></li><li>UML Classes<br /></li><li>UML Class Superclass Relationships<br /></li><li>UML Packages<br /></li><li>UML Package Relationships</li></ol><p>Each rule will now be described.</p><br /><div><a href="#contents"><img src="http://www.linkedmodels.org/images/uml2owl/up_arrow.jpg" width="15" height="15" />Top</a></div><br /><h4 id="generationOfUMLMetaClasses">Generation of UML Metaclasses</h4>The first task is to create a metaclass and class for every type of element in the ingested XMI file. This is done using the SPARQL Rule below:<br /><pre class="spinBlock"><br /># STEP CMOF-SR-001 make UML Metaclass from CMOF type<br />CONSTRUCT {<br /> ?metaClassURI a rdfs:Class .<br /> ?metaClassURI rdfs:subClassOf cmof:MetaClass .<br /> ?metaClassURI rdfs:label ?metaClassLabel .<br /> ?typeURI a owl:Class .<br /> ?typeURI a ?metaClassURI .<br /> ?typeURI rdfs:subClassOf uml:Construct .<br /> ?typeURI rdfs:label ?classLabel .<br /> }<br />WHERE {<br /> ?this xmi:type ?type .<br /> FILTER (?type != "cmof:Property") .<br /> BIND (o2o:localNameOfQName(?type) AS ?name) .<br /> BIND (fn:concat("CMOF ", ?name) AS ?metaClassLabel) .<br /> BIND (fn:concat("UML ", ?name) AS ?classLabel) .<br /> BIND (xmi.common:makeUML-URI(?name) AS ?typeURI) .<br /> BIND (xmi.common:makeCMOF-URI(?name) AS ?metaClassURI) .<br />}<br /></pre><p class="caption">Figure 10: The SPARQL Rules that make the metaclasses in the OCMOF model</p>What is going on in these rules? First we explain the "where" clause.<br /><br /><div class="sparqlDetails"><p class="sparqlDetails"><code class="rdfStatement">?this xmi:type ?type</code> binds <code>?this</code> to an instance of <code>TypedThing</code>. For each instance the rule is evaluated.</p><p class="sparqlDetails"><code class="rdfStatement">FILTER (?type != "cmof:Property")</code> blocks further evaluation of the rule if the instance is of type <code>cmof:Property</code>. The reason for this will be explained in Part 2.</p><p class="sparqlDetails"><code class="rdfStatement">BIND (o2o:localNameOfQName(?type) AS ?name)</code> extracts the name of the type from the QName.</p><p class="sparqlDetails"><code class="rdfStatement">BIND (fn:concat("CMOF ", ?name) AS ?metaClassLabel )</code> builds a label for the metaclass. The function <code>fn:concat</code> is from the <a href="http://jena.sourceforge.net/ARQ/library-function.html">JENA SPARQL Library</a>. We use it here to prepend "CMOF" to the name we get from the type of the XMI Element.</p><br /><p class="sparqlDetails"><code class="rdfStatement">BIND (fn:concat("UML ", ?name) AS ?classLabel)</code> makes a class label from the name. We will be constructing both a metaclass and a class from the XMI type. We build a metaclass in order to say what kind of things can happen on the classes. In other words, the generated OWL model is a 3-level ontology. Likewise here we build a label for the UML Class.</p><p class="sparqlDetails"><code class="rdfStatement">BIND (xmi.common:makeUML-URI(?name) AS ?typeURI)</code> builds a URI for the UML Class corresponding to <code>type</code>. This uses a function call to <code>xmi.common:makeUML-URI</code> whose job it is to build the correct namespace path for a UML construct URI. The implementation is shown below.<br /></p><div class="indentedSparqlDetails"><pre class="spinBlock">SELECT ?uri<br />WHERE {<br /> BIND (xmi.common:baseURI() AS ?baseURI) .<br /> BIND (smf:buildURI("{?baseURI}#{?arg1}") AS ?uri) .<br />}<br /></pre><br /><p class="sparqlDetails">where,<br /><code class="rdfStatement">smf:buildURI("{?baseURI}#{?arg1}"))</code> builds a URI for the name given in <code>?arg1</code> with a base URI supplied by the function <code>xmi.common:baseURI()</code>.</p></div><p></p><p class="sparqlDetails"><code class="rdfStatement">BIND (xmi.common:makeCMOF-URI(?name) AS ?metaClassURI )</code> builds a URI for the metaclass corresponding to <code>type</code>. Likewise this constructs a namspace path for CMOF constructs.</p></div><br /><p>Next we explain what is happening in the head of the rule with the <code>Construct</code> statements. These statements use the generated URIs to create instances of meta-classes and classes.</p><br /><div class="sparqlDetails"><p class="sparqlDetails"><code class="rdfStatement">?metaClassURI a rdfs:Class</code><br />gives the metaClass its type.</p><br /><p class="sparqlDetails"><code class="rdfStatement">?metaClassURI rdfs:subClassOf cmof:MetaClass</code><br />specifies that the metaclass is a sub-class of <code>cmof:MetaClass</code> - an abstract metaclass for all cmof classes.</p><p class="sparqlDetails"><code class="rdfStatement">?metaClassURI rdfs:label ?metaClassLabel</code><br />gives the metaclass a human label.</p><p class="sparqlDetails"><code class="rdfStatement">?typeURI a owl:Class</code><br />gives the UML Class a type</p><p class="sparqlDetails"><code class="rdfStatement">?typeURI a ?metaClassURI</code><br />gives the UML Class a more specific type so that it can have more properties than <code>owl:Class</code> provides.</p><p class="sparqlDetails"><code class="rdfStatement">?typeURI rdfs:subClassOf uml:Construct</code><br />specifies that the UML Class is a subclass of the abstract OWL Class <code>uml:Construct</code>/</p><p class="sparqlDetails"><code class="rdfStatement">?typeURI rdfs:label ?classLabel</code><br />gives the UML Class a human label.</p></div><br /><div><a href="#contents"><img src="http://www.linkedmodels.org/images/uml2owl/up_arrow.jpg" width="15" height="15" />Top</a></div><br /><h4 id="generationOfUMLClasses">Generation of UML Classes</h4>Once we have the necessary metaclasses we can begin the work of creating instances of those classes. These instances will, of course, be classes (the meta-world can get confusing). This work is done the the SPARQL Rule below.<br /><pre class="spinBlock"><br /># STEP CMOF-SR-002 make UML Classes from CMOF elements<br />CONSTRUCT {<br /> ?type a rdfs:Class .<br /> ?type rdfs:subClassOf cmof:MetaClass .<br /> ?class a ?type .<br /> ?class rdfs:label ?name .<br /> ?class ocmof:hasCMOFbasis ?this .<br /> ?superURI a owl:Class .<br /> ?superURI a cmof:CategoryClass .<br /> ?superURI rdfs:label ?super .<br /> ?subURI a owl:Class .<br /> ?subURI a cmof:CategoryClass .<br /> ?subURI rdfs:subClassOf ?superURI .<br /> ?subURI rdfs:label ?sub .<br /> ?class rdfs:subClassOf ?mySuperClass .<br />}<br />WHERE {<br /> ?this xmi:type "cmof:Class" .<br /> ?this xmi:id ?name .<br /> BIND (o2o:pathPart(?name, "-") AS ?path) .<br /> OPTIONAL {<br /> ?path o2o:pairHyphenIncrementally ( ?super ?sub ) .<br /> BIND (xmi.common:makeUML-URI(smf:buildString("CLASSES_{?super}")) AS ?superURI) .<br /> BIND (xmi.common:makeUML-URI(smf:buildString("CLASSES_{?sub}")) AS ?subURI) .<br /> BIND (xmi.common:makeCMOF-Resource("cmof:Class") AS ?type) .<br /> BIND (xmi.common:makeUML-URI(?name) AS ?class) .<br /> } .<br /> BIND (xmi.common:makeUML-URI(smf:buildString("CLASSES_{?path}")) AS ?mySuperClass) .<br /> }<br /></pre><p class="caption">Figure 11: The SPARQL Rules that make UML Classes</p>More details of this transformation will be given in Part 2 of this blog series. An interesting aspect of this particular rule to mention now is how it builds deep inheritance structures by using <a href="http://jena.sourceforge.net/ARQ/extension.html">Property Functions</a> to recurse over hyphenated names (more on the use of Property Functions, also known as Magic Properties, with TopBraid Composer can be found at <a href="http://composing-the-semantic-web.blogspot.com/2009/11/magic-properties-with-spin.html">this blog entry</a>). These hyphenated names occur throughout the XMI metamodel of UML. For example <code>Core-Basic-Class</code> looks like:<br /><pre class="xmlBlock"><ownedMember xmi:type="cmof:Class" xmi:id="Core-Basic-Class" name="Class" superClass="Core-Basic-Type"><br /> <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Basic-Class-_ownedComment.0"<br /> annotatedElement="Core-Basic-Class"><br /> <body>A class is a type that has objects as its instances.</body><br /> </ownedComment><br /> <ownedAttribute xmi:type="cmof:Property" xmi:id="Core-Basic-Class-isAbstract"<br /> name="isAbstract" type="Core-PrimitiveTypes-Boolean" default="false"><br /> <ownedComment xmi:type="cmof:Comment" xmi:id="Core-Basic-Class-isAbstract-_ownedComment.0" annotatedElement="Core-Basic-Class-isAbstract"><br /> <body>True when a class is abstract.</body><br /> </Attribute><br /></pre><p class="caption">Figure 12: Example of Hyphenated Names in the UML Metamodel</p><br /><p>How this is done in the SPARQL Rule is explained briefly below.</p><br /><div class="sparqlDetails"><p class="sparqlDetails">In the SPARQL Rule shown above in figure 11, the statement in the tail: <code class="rdfStatement">?path o2o:pairHyphenIncrementally ( ?super ?sub )</code> is a Property Function that returns two results: <code>?super</code> and <code>?sub</code> for every hypenated pair.<br />for each pair the statement: <code class="rdfStatement">?subURI rdfs:subClassOf ?superURI</code> in the head of the rule builds superclass relationships.</p></div><br /><div><a href="#contents"><img src="http://www.linkedmodels.org/images/uml2owl/up_arrow.jpg" width="15" height="15" />Top</a></div><br /><h4 id="generationOfUMLSubClassOfs">Generation of UML Class Superclass Relationships</h4>Once we have all of the UML Classes, the next rule can build the <code>rdfs:subClassOf</code> relationships.<br /><pre class="spinBlock"># STEP CMOF-SR-005 - fixup the superclass of the root Classes<br />CONSTRUCT {<br /> ?class rdfs:subClassOf uml:Class .<br />}<br />WHERE {<br /> ?class a cmof:CategoryClass .<br /> BIND (afn:localname(?class) AS ?className) .<br /> FILTER fn:starts-with(?className, "CLASSES_") .<br /> NOT EXISTS {<br /> ?class rdfs:subClassOf ?superClass .<br /> } .<br />}<br /></pre>The result of executing the preceding UML Class rules is the UML Class Hierarchy shown in the diagram below.<br /><a href="http://www.linkedmodels.org/images/uml2owl/uml-classes-hierarchy.png" onclick="diagramPopUp(this.href); return false;"><br /><img src="http://www.linkedmodels.org/images/uml2owl/uml-classes-hierarchy.png" alt="UML Metamodel Class Hierarchy" class="center" width="404 px;" height="594 px;" /><p class="caption">Figure 13: Generated UML Metamodel Class Hierarchy</p></a><a href="#contents"><img src="http://www.linkedmodels.org/images/uml2owl/up_arrow.jpg" width="15" height="15" />Top</a><br /><h4 id="generationOfUMLPackages">Generation of UML Packages</h4><pre class="spinBlock"># STEP CMOF-SR-020 - make Packages<br />CONSTRUCT {<br /> ?package rdfs:label ?name .<br /> ?package ocmof:hasCMOFbasis ?this .<br /> ?mySuperClass a owl:Class .<br /> ?mySuperClass rdfs:label ?path .<br /> ?superURI a owl:Class .<br /> ?superURI a cmof:CategoryClass .<br /> ?superURI rdfs:label ?super .<br /> ?subURI a owl:Class .<br /> ?subURI a cmof:CategoryClass .<br /> ?subURI rdfs:subClassOf ?superURI .<br /> ?subURI rdfs:label ?sub .<br /> ?package a ?mySuperClass .<br /> ?package a uml:Package .<br />}<br />WHERE {<br /> ?this xmi:type "cmof:Package" .<br /> ?this xmi:id ?name .<br /> BIND (xmi.common:makeUML-URI(?name) AS ?package) .<br /> BIND (o2o:pathPart(?name, "-") AS ?path) .<br /> OPTIONAL {<br /> ?path o2o:pairHyphenIncrementally ( ?super ?sub ) .<br /> BIND (xmi.common:makeUML-URI(smf:buildString("PACKAGES_{?super}")) AS ?superURI) .<br /> BIND (xmi.common:makeUML-URI(smf:buildString("PACKAGES_{?sub}")) AS ?subURI) .<br /> } .<br /> BIND (xmi.common:makeUML-URI(smf:buildString("PACKAGES_{?path}")) AS ?mySuperClass) .<br />}<br /></pre><br /><div><a href="#contents"><img src="http://www.linkedmodels.org/images/uml2owl/up_arrow.jpg" width="15" height="15" />Top</a></div><br /><h4 id="generationOfUMLPackageRelationships">Generation of UML Package Relationships</h4><br /><pre class="spinBlock"># STEP CMOF-SR-024 - fixup the superclass of the root Packages<br />CONSTRUCT {<br /> ?packageClass rdfs:subClassOf uml:Package .<br />}<br />WHERE {<br /> ?this xmi:type "cmof:Package" .<br /> ?package ocmof:hasCMOFbasis ?this .<br /> ?package a ?packageClass .<br /> NOT EXISTS {<br /> ?packageClass rdfs:subClassOf ?superClass .<br /> } .<br /> }<br /></pre>The result of executing the preceding UML Package rules is the UML Package Hierarchy shown in the diagram below.<br /><a href="http://www.linkedmodels.org/images/uml2owl/uml-packages-hierarchy.png" onclick="diagramPopUp(this.href); return false;"><br /><img src="http://www.linkedmodels.org/images/uml2owl/uml-packages-hierarchy.png" alt="UML Metamodel Packages Hierarchy" class="center" width="404 px;" height="290 px;" /><p class="caption">Figure 14: Generated UML Metamodel Package Hierarchy</p><br /></a><br /><div><a href="#contents"><img src="http://www.linkedmodels.org/images/uml2owl/up_arrow.jpg" width="15" height="15" />Top</a></div><br /><h3 id="performance">Performance</h3>As a measurement of the performance with the TopBraid Composer release 3.4.0, the conversion of the UML Infrastructure XMI took 38.611 seconds and generated 19,575 statements (RDF triples) on a DELL Studio XPS Laptop with 4GB of memory, running Windows 7. This translates to an inference speed of 507 TPS (Triples per second).<br /><div><a href="#contents"><img src="http://www.linkedmodels.org/images/uml2owl/up_arrow.jpg" width="15" height="15" />Top</a></div><br /><h3 id="conclusion">Concluding Remarks</h3>Part 1 of this blog has introduced the power of model-based transformation using SPARQL Rules as a means to transform XMI to OWL. Our experience in doing this work confirms the extensibility and flexibility of this approach. The subject is a complex one requiring a grounding in the intricacies of UML Metamodeling, and a knowledge of SPARQL and SPARQL Rules. We have attempted to do that briefly in this blog - not an easy matter.<br /><p>Part 2 of this blog series will discuss transforming UML Models to OWL Using SPARQL.</p><br /></div>ralphtqhttp://www.blogger.com/profile/11340855777025790541noreply@blogger.com1tag:blogger.com,1999:blog-7507012841435012041.post-58908281953647426732011-01-19T05:12:00.000-08:002011-01-19T05:14:56.941-08:00Running TopBraid Live in the Amazon EC2 cloud<span class="Apple-style-span" style="font-family: arial, helvetica; font-size: 14px; "><p style="font-family: arial, helvetica; font-size: 10pt; ">A <a href="http://dilbert.com/strips/comic/2011-01-07">recent Dilbert strip</a> inspired me to go through Dave Winer's <a href="http://howto.opml.org/dave/ec2/">EC2 for Poets</a> tutorial as a geeky weekend project. It was surprisingly easy and inexpensive to get a computer image running in Amazon's "Elastic Computing Cloud" (EC2) and to then get a copy of TopQuadrant's TopBraid Live running in that image.</p><img src="http://www.snee.com/bobdc.blog/img/tq/tblonec2.jpg" width="590" /><p style="font-family: arial, helvetica; font-size: 10pt; ">These images are cheap to run, as you can see on their <a href="http://aws.amazon.com/ec2/#pricing">price list</a>. Note that the cost per hour of running a default Linux image is not eighty-five cents an hour when using servers in northern Virginia, but eight and a half cents. (It's an additional penny an hour when using their servers in California, Ireland, or Singapore.) If you're willing to spend a dollar or two an hour, you can get full control of some really large-scale computing power without spending much money unless you're planning some long-term use of it, in which case you'll want to compare the options with your requirements more closely than I did. You'll want one of the <a href="http://aws.amazon.com/ebs/">EBS</a> images, which still offers you a wide choice of platforms. Otherwise, the only way to stop a running image is to terminate it, in which case it (and all your configuration of it) is gone. With an EBS image, once you stop running it, you can always restart it.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">I started off with an Ubuntu Linux image, but I had trouble installing Sun Java on it. After starting up a Fedora image, installing Sun Java and Tomcat were easy, and once Tomcat was installed, the installation of TopBraid Live under Tomcat according to the TBL installation instructions was simple and straightforward.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">The ease with which I switched my efforts from Ubuntu to Fedora was an important lesson in cloud use; it sure was easier than installing Fedora over Ubuntu on a laptop hard disk, and if I decided to switch back, going back to the Ubuntu EC2 image would take seconds, unlike reverting a hard disk once I'd overwritten the Ubuntu image with Fedora. You can initialize several different images in the EC2 cloud, and if you're not running any of them, Amazon only bills you for storage, which is pennies, so you can set up several to wait for you and start and stop them whenever you like. If you want more memory, cluster processing, 64-bit instead of 32-bit, or other additional resources, you can just try it and see how it goes. This means that when you plan out the deployment of TopBraid applications using 32- or 64-bit TBL, you don't have to worry too much about having an available machine with the best possible operating system and hardware configuration, because you can experiment with different cloud images until you find the setup that's best for you. (I never tried a Windows image or SUSE or one of the other Linux images, but if I was going to roll out a production TBL application I'd explore these further as part of my planning.)</p><p style="font-family: arial, helvetica; font-size: 10pt; ">It's pretty impressive to think about the kind of power and flexibility that you can get when you deploy cloud-based semantic web applications, and as I found out with my little experiment, the barriers to entry for trying it out are extremely low. After 16 hours of running one instance, 3 hours of running another, and 3.1 GB of data transfer in the last few weeks, I currently owe Amazon Web Services a total of $2.29. So, if you're holding off on trying TBL because you don't have the appropriate box on which to run it, Amazon's EC2 offers some nice options to try out.</p></span>Bob DuCharmehttp://www.blogger.com/profile/02742075186312518829noreply@blogger.com0tag:blogger.com,1999:blog-7507012841435012041.post-49081886115344293672010-12-29T11:10:00.000-08:002010-12-29T11:13:34.106-08:00How to: convert a spreadsheet to SKOS<span class="Apple-style-span" style="font-family: arial, helvetica; font-size: 13px; "><p style="font-family: arial, helvetica; font-size: 10pt; ">In an <a href="http://bit.ly/bIbTbc">earlier</a> entry, we learned how SPARQL Rules can increase the quality of taxonomies and other controlled vocabularies stored using the W3C SKOS ontology. (As I wrote there, the <a href="http://www.w3.org/TR/#tr_SKOS">Simple Knowledge Organization System</a>vocabulary management specification is gaining popularity because, as a standard, it makes it easier to share taxonomies and thesaurii between different systems. It also guards investments in vocabulary development against the potential problems of dependence on a proprietary vendor format.)</p><p style="font-family: arial, helvetica; font-size: 10pt; ">TopQuadrant's <a href="http://www.topquadrant.com/solutions/ent_vocab_net.html">Enterprise Vocabulary Net</a> (EVN) vocabulary manager uses SKOS as its default format for storing data. Whether you use EVN or not, a first step in systematic management of vocabularies is often the conversion of vocabularies stored in ad hoc spreadsheets—an unfortunately very popular way to store them—to SKOS, so today we'll look at how TopBraid makes this conversion easy.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">Below is an Excel spreadsheet with some data about a few Caniformia animals. (In the Linnaeus classification of animals, Caniformia is the suborder of Carnivora, which is an order of the Mammalia class.) It shows two families of this suborder and a few genuses and species of each family, with both the Latin and common name of each species.</p><img src="http://www.snee.com/bobdc.blog/img/tq/xls2skos2.jpg" /><p style="font-family: arial, helvetica; font-size: 10pt; ">Using a SPARQLMotion script, the basic steps of converting a spreadsheet like this to SKOS are:</p><ol><li style="font-family: arial, helvetica; font-size: 10pt; "><p style="font-family: arial, helvetica; font-size: 10pt; ">Read in the spreadsheet as a set of RDF triples.</p></li><li style="font-family: arial, helvetica; font-size: 10pt; "><p style="font-family: arial, helvetica; font-size: 10pt; ">Use a CONSTRUCT query to convert the spreadsheet triples to SKOS triples. This is the step that varies the most from one conversion to another, because people can arrange spreadsheets any way they want, so the logic of the CONSTRUCT query has to infer the correct relationships between the values on the spreadsheet.</p></li><li style="font-family: arial, helvetica; font-size: 10pt; "><p style="font-family: arial, helvetica; font-size: 10pt; ">Save the SKOS triples as an RDF file or in whatever format is appropriate to your applications that will use this data.</p></li></ol><p style="font-family: arial, helvetica; font-size: 10pt; ">The following shows the SPARQLMotion script that I used to convert the spreadsheet above.</p><img src="http://www.snee.com/bobdc.blog/img/tq/xls2skos3.jpg" /><p style="font-family: arial, helvetica; font-size: 10pt; ">It has a module for each of the three steps listed above and an additional <tt>SetBaseURIStr</tt> module to set a <tt>?baseURIStr</tt> variable. The script refers to the base URI of the output several times, and instead of hardcoding it in all those places, I decided to use this module to set this variable and to then reference the variable from other places so that resetting the base URI could be done in one place. The "set BaseURIString" module has a very simple SELECT query:</p><pre style="margin-top: 14pt; margin-bottom: 14pt; margin-left: 14pt; ">SELECT ?baseURIStr<br />WHERE {<br /> LET (?baseURIStr := "http://example.com/taxonomies/animals") .<br />}<br /></pre><p style="font-family: arial, helvetica; font-size: 10pt; ">When you import an Excel file into TopBraid, the "Import Excel Cell Instances" SPARQLMotion module can pull triples from the spreadsheet with information such as the fact that a given cell has a row value of 7 (using zero-based counting), a column value of 0, a type value of "xsd:string", and "giant panda" as its contents. This level of detail can be useful for picking apart complex spreadsheets, but for simpler ones, if you instead use an "Import RDF from Workspace" module (in other words, if you have the script open the spreadsheet as if it were an RDF file), TopBraid uses the headings of the spreadsheet to identify more of the semantics of the data. For example, it would create triples saying that the thing identified as <tt>Row-6</tt> has a <tt>commonName</tt> value of "giant panda" and a <tt>genus</tt> value of "Ailuropoda". This will be easier to convert to SKOS with a CONSTRUCT query.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">There are five basic tasks that the conversion module must perform, all through the creation of triples:</p><ol><li style="font-family: arial, helvetica; font-size: 10pt; "><p style="font-family: arial, helvetica; font-size: 10pt; ">Declare that the dataset being created is an ontology.</p></li><li style="font-family: arial, helvetica; font-size: 10pt; "><p style="font-family: arial, helvetica; font-size: 10pt; ">Import the standard W3C SKOS ontology so that we can reference its classes and properties.</p></li><li style="font-family: arial, helvetica; font-size: 10pt; "><p style="font-family: arial, helvetica; font-size: 10pt; ">Declare a concept scheme. A SKOS vocabulary can have as many concept schemes as you like, but we'll just create one for our example.</p></li><li style="font-family: arial, helvetica; font-size: 10pt; "><p style="font-family: arial, helvetica; font-size: 10pt; ">Declare concepts for each species, genus, and family found in the input triples, with a <tt>skos:broader</tt> property pointing from each one to either the appropriate broader concept or, if there is none, to the concept scheme created in the previous step.</p></li><li style="font-family: arial, helvetica; font-size: 10pt; "><p style="font-family: arial, helvetica; font-size: 10pt; ">Create triples that attach any additional metadata to the appropriate concepts—in this case, to assign the common name value to each species concept. SKOS is very flexible, so if you had additional non-SKOS properties specific to your own applications that you wanted to assign to each concept, the steps would be similar to the ones for attaching the common name values from this spreadsheet to each concept.</p></li></ol><p style="font-family: arial, helvetica; font-size: 10pt; ">Whe the "Import RDF from Workspace" module reads in a spreadsheet such as caniformia.xls, it uses the spreadsheet's filename to define a prefix for the spreadsheet's properties so that it can refer to those properties with names like <tt>caniformia:genus</tt>. After opening the spreadsheet directly in TopBraid Composer, I saw that the base URI created for the data and associated with the <tt>caniformia:</tt> prefix was file:///xls2skos/caniformia.xls, because I had it in a project named xls2skos. I wanted to use this prefix in my SPARQLMotion script's CONSTRUCT query, so I associated this URI with the <tt>caniformia:</tt> prefix in the Overview tab of the xls2skos.n3 file that stored the SPARQLMotion script.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">The actual conversion takes place in the Apply Construct module that I named "convert XLSData". These modules can store multiple CONSTRUCT queries, so I used two. The first does the basic setup of the taxonomy being created, which are the first three of the five tasks listed above:</p><pre style="margin-top: 14pt; margin-bottom: 14pt; margin-left: 14pt; ">CONSTRUCT {<br /> ?baseURI a owl:Ontology .<br /> ?baseURI owl:imports <http://www.w3.org/2004/02/skos/core> .<br /> <http://example.com/taxonomies/animals/caniformia> a skos:ConceptScheme .<br /> <http://example.com/taxonomies/animals/caniformia> rdfs:label "Caniformia" .<br />}<br />WHERE {<br /> LET (?baseURI := smf:buildURI("<{?baseURIStr}>")) .<br />}<br /></pre><p style="font-family: arial, helvetica; font-size: 10pt; ">The second query performs steps 4 and 5:</p><pre style="margin-top: 14pt; margin-bottom: 14pt; margin-left: 14pt; ">CONSTRUCT {<br /> ?speciesURI a skos:Concept .<br /> ?genusURI a skos:Concept .<br /> ?familyURI a skos:Concept .<br /> ?speciesURI skos:prefLabel ?speciesName .<br /> ?speciesURI skos:altLabel ?commonName .<br /> ?speciesURI skos:broader ?genusURI .<br /> ?genusURI skos:broader ?familyURI .<br /> <http://example.com/taxonomies/animals/caniformia> skos:hasTopConcept ?familyURI .<br />}<br />WHERE {<br /> ?row caniformia:commonName ?commonName .<br /> ?row caniformia:species ?speciesName .<br /> LET (?species := smf:encodeURL(?speciesName)) .<br /> LET (?speciesURI := smf:buildURI("<{?baseURIStr}#{?species}>")) .<br /> ?row caniformia:genus ?genusName .<br /> LET (?genus := smf:encodeURL(?genusName)) .<br /> LET (?genusURI := smf:buildURI("<{?baseURIStr}#{?genus}>")) .<br /> ?row caniformia:family ?familyName .<br /> LET (?family := smf:encodeURL(?familyName)) .<br /> LET (?familyURI := smf:buildURI("<{?baseURIStr}#{?family}>")) .<br />}<br /></pre><p style="font-family: arial, helvetica; font-size: 10pt; ">In addition to creating a SKOS concept for each species, it creates one for each genus and family as well, using the <tt>skos:broader</tt> property to identify the connections between these concepts that make up the hierarchical taxonomy of terms.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">One big decision to make with this query was how to create URIs that provided unique identifiers for each new concept being created. I knew that the species, family, and genus names must be unique, so I added those to the base URI after passing them to smf:encodeURL(), a SPARQLMotion extension function that escapes any characters that won't work well in a URI. If you have taxonomy data in a spreadsheet, there may already be a unique number or other form of ID assigned to some or all taxonomy terms that your conversion can grab so that you don't have to create URIs from the names on the spreadsheet like I did.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">I also decided to use species names like "Canis lupus" as the <tt>skos:preferredLabel</tt> value in the output and to use labels from the spreadsheet's "common name" column like "gray wolf" as <tt>skos:altLabel</tt> values. If you wanted to to use common name values as preferred labels and species names as alternative labels, it would be a simple change to the query above.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">My "convert XLSData" module also has its <tt>sml:replace</tt> value set to <tt>True</tt> so that it doesn't pass along the input triples to the final module, which saves the conversion result. This last module, which I named "Save as TDB", is an "Export to TDB" SPARQLMotion module that saves the conversion results using the Jena TDB format. I could have used a SPARQLMotion "Export to RDF" module, which saves triples as a Turtle or RDF/XML disk file, but I wanted to use the results of my conversion in EVN. EVN requires that you use Jena's TDB or SDB formats so that it can attach metadata to your work to support reporting and workflow tracking.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">After running the conversion, here is one view of it in EVN:</p><img src="http://www.snee.com/bobdc.blog/img/tq/xls2skos1.jpg" width="590" /><p style="font-family: arial, helvetica; font-size: 10pt; ">This is a minimal example using a small spreadsheet with no non-SKOS metadata. If your spreadsheet includes columns for data that don't fit easily into the SKOS model, you can use TopBraid Composer to create a customized version of SKOS that includes your own properties, and your SPARQLMotion script's conversion module can then add triples for those properties to the result. Viewing them in EVN, they would appear under <b>Custom Properties</b> on the right. And of course, the screen shot above only hints at all that EVN lets you do with your controlled vocabulary once you convert it to SKOS.</p></span>Bob DuCharmehttp://www.blogger.com/profile/02742075186312518829noreply@blogger.com0tag:blogger.com,1999:blog-7507012841435012041.post-58222806675562084102010-11-10T06:59:00.000-08:002010-11-10T07:03:53.344-08:00Getting started with SPARQL Web Pages<span class="Apple-style-span" style="font-family: arial, helvetica; "><p style="font-family: arial, helvetica; font-size: 10pt; ">In earlier entries on this blog, we've seen how SPARQL Rules attached to classes can let you <a href="http://topquadrantblog.blogspot.com/2010/08/how-to-find-skos-constraint-violations.html">identify constraint violations</a> in instances of those classes and implement other kinds of business logic, all using the SPARQL standard. With release 3.4, which is now in beta, TopQuadrant products have another new application of SPARQL that lets you attach useful metadata to class definitions: descriptions of how you want the class's instances to look in a browser. We call this SPARQL Web Pages.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">TopQuadrant vice president of product development Holger Knublauch has written several blog entries introducing SPARQL Web Pages under its original name, UISPIN, such as <a href="http://composing-the-semantic-web.blogspot.com/2010/03/uispin-creating-html-and-svg-documents.html">UISPIN: Creating HTML and SVG Documents with SPARQL</a>, <a href="http://composing-the-semantic-web.blogspot.com/2010/04/charts-and-business-reports-with-uispin.html">Charts and Business Reports with UISPIN</a>, and <a href="http://composing-the-semantic-web.blogspot.com/2010/04/uispin-example-documenting-spin.html">UISPIN Example: Documenting SPIN Functions</a>. In this blog entry, we'll see how to get started with a simple but useful example.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">Address book information is not as simple to represent in RDF as one might think. A street address, city name, and postal code should be shown in a specific order, but RDF facilities for ordering the property values for a given instance can add annoying layers of complexity to a data model. Without ordering, though a simple address book entry can be difficult to read, like the following fake address shown in Turtle format:</p><br /><pre style="margin-top: 14pt; margin-bottom: 14pt; margin-left: 14pt; ">a:Entry_1<br /> rdf:type a:Entry ;<br /> a:city "San Diego" ;<br /> a:email "jerry122@hotmail.com" ;<br /> a:firstName "Jerry" ;<br /> a:homePhone "(738) 610-2019" ;<br /> a:lastName "Snyder" ;<br /> a:mobile "(702) 382-4712" ;<br /> a:postalCode "39248" ;<br /> a:region "CA" ;<br /> a:streetAddress "3137 11th Ave." .</pre><br /><p style="font-family: arial, helvetica; font-size: 10pt; ">Using TopBraid Composer Maestro Edition, I created an RDF file with an Entry class for address book entries. I declared the properties shown above, with the Entry class as their domain, and then I added a few fake address book instances to the file. The file has a base URI of http://example.org/addressBook, which will be important later.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">Next, I imported the html.rdf model from the UISPIN folder of the TopBraid project that is automatically added to every workspace. (In a production application, especially if I was working with a standard ontology instead of a hand-crafted little model defining an address book entry, I'd create a new file that imported the standard class and property definitions as well as html.rdf instead of adding the SPARQL Web page definitions directly into the file that defines the address book model.) The UISPIN folder also includes models to generate SVG, charts, and more; the html.rdf file lets you add HTML-generating SPARQL code to your classes. Below, you can see how I've added the ui:instanceView property from this file's model to the definition of my Entry class:</p><img src="http://www.snee.com/bobdc.blog/img/tq/swebpgs1.jpg" width="590" /><p style="font-family: arial, helvetica; font-size: 10pt; ">When I scroll the Class View down a little, you can see what I entered as the ui:instanceView property value. It's an HTML template, with instructions for plugging in instance data, that will be output whenever TopBraid sees an instance of this class:</p><img src="http://www.snee.com/bobdc.blog/img/tq/swebpgs2.jpg" /><p style="font-family: arial, helvetica; font-size: 10pt; ">It lays out an <tt>div</tt> element that begins with the address entry's mailing address and then has a small table showing the entry's email address and phone numbers, with these property names bolded in the output. You can take advantage of the full power of SPARQL in these templates, as you'll see in Holger's blog entries, but I kept things simple by mostly just using the spl:object() function to insert specific property values into various places in the HTML.</p><p style="font-family: arial, helvetica; font-size: 10pt; ">When I view the form tab of the Entry class and click on a row in the Instances view, I see a Resource Form for that instance, like I always did:</p><img src="http://www.snee.com/bobdc.blog/img/tq/swebpgs3.jpg" /><p style="font-family: arial, helvetica; font-size: 10pt; ">You can see a new <b>Browser</b> tab next to the <b>Form</b> tab, though, and it lets me see the instance view formatted according to the HTML template that I created in the ui:instanceView value:</p><img src="http://www.snee.com/bobdc.blog/img/tq/swebpgs4.jpg" /><p style="font-family: arial, helvetica; font-size: 10pt; ">Even better, TopBraid Live can serve up the data using these HTML templates outside of TopBraid Composer, so that sending a browser to the URL<a href="http://localhost:8083/tbl/uispin?_resource=http://example.org/addressBook%23Entry_1&_baseURI=http://example.org/addressBook">http://localhost:8083/tbl/uispin?_resource=http://example.org/addressBook%23Entry_1&_baseURI=http://example.org/addressBook</a> displays the result in the browser (note the use of the base URI to specify the model with the data to display and the escaping of "#" as "%23"):</p><img src="http://www.snee.com/bobdc.blog/img/tq/swebpgs5.jpg" width="590" /><p style="font-family: arial, helvetica; font-size: 10pt; ">Of course, this HTML can also have links and reference CSS, Javascript, web services, and other applications on the TBL server where it's hosted, so you can build some very sophisticated user interfaces. Check out Holger's blog entries for further ideas on where you can take this, especially when you start incorporating SPARQL queries and their results into the templates.</p></span>Bob DuCharmehttp://www.blogger.com/profile/02742075186312518829noreply@blogger.com0tag:blogger.com,1999:blog-7507012841435012041.post-18044783580954671732010-10-27T08:44:00.000-07:002010-10-27T08:49:06.416-07:00TopQuadrant's new Enterprise Vocabulary Manager<span class="Apple-style-span" style="font-family: arial, helvetica; font-size: 19px; "><a id="id103311" href="http://www.topquadrant.com/solutions/ent_vocab_net.html"><img id="id103315" src="http://www.topquadrant.com/images/TBEVN_logo.jpg" border="0" style="border-style: none;" align="right" hspace="30px" vspace="30px" alt="EVN logo" width="240px" /></a><p id="id103336" style="font-family: arial, helvetica; font-size: 10pt; ">The TopBraid platform can be used to build all kinds of applications and solutions. We've recently noticed one particular area where more and more customers needed help, and where semantic technology and our tools were a great fit: the management of multiple connected vocabularies spread out across an enterprise. To meet this need, we've created <a id="id103345" href="http://www.topquadrant.com/solutions/ent_vocab_net.html">TopBraid Enterprise Vocabulary Net</a> (EVN), a solution that works out of the box while having all the power of TopBraid Suite behind its customization capabilities.</p><p id="id103356" style="font-family: arial, helvetica; font-size: 10pt; ">The EVN <a id="id103359" href="http://www.topquadrant.com/solutions/ent_vocab_net.html">product page</a> has a long list of its features, which provide everything you need to manage taxonomies and thesaurii (and even create simple ontologies) in multi-user environments. The ability to review proposed changes before rolling them into production, with a choice of reports and other options for analyzing those changes and their potential impact, will be especially useful in larger organizations.</p><p id="id103375" style="font-family: arial, helvetica; font-size: 10pt; ">The use of EVN requires no knowledge of SKOS, RDF, or the related W3C standards, but the use of these standards behind EVN's graphical user interface is what makes EVN both flexible and scalable. The use of public standards for data, models, and application logic makes it much easier to integrate EVN with other systems than any other vocabulary management solutions we've seen in the marketplace. They also make it easier for EVN to let you set up an environment where different vocabularies in different parts of a large organization can work cooperatively with no need to merge those vocabularies into a single large, central vocabulary.</p><p id="id103389" style="font-family: arial, helvetica; font-size: 10pt; ">EVN is included in TopBraid Composer Maestro Edition release 3.4, which is now in beta, so you can try it without purchasing a separate product. For a quick overview of the features and what the product looks like, start with the<a id="id103396" href="http://www.topquadrant.com/docs/marcom/TopBraid_EVN_Screenshots_Tour.pdf">screenshot tour</a>, or jump right in to the tutorial included with EVN's <a id="id103404" href="http://topquadrant.com/topbraid/evn/doc/">documentation</a>.</p></span>Bob DuCharmehttp://www.blogger.com/profile/02742075186312518829noreply@blogger.com0tag:blogger.com,1999:blog-7507012841435012041.post-39542850149560256042010-10-04T06:54:00.000-07:002010-10-04T06:57:27.149-07:00How to: read RSS and RDFa from the web with a SPARQLMotion script<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: medium; "><p>How do you get a SPARQLMotion script to read an RSS or Atom feed as RDF triples? How do you get a SPARQLMotion script to read triples that have been embedded into web pages using RDFa? The answer to both questions is the same: use the specialized SPARQLMotion module for the task. All you have to do is specify the URL of the file with the information you want to read.</p><p>To demonstrate both, we'll put together a short script that:</p><ol><li><p>Reads the RSS feed about technology news from <a href="http://www.newsweek.com/">Newsweek</a> magazine</p></li><li><p>Pulls the triples from the RDFa embedded in the Newsweek articles described in the feed</p></li><li><p>Saves the extracted triples in a <a href="http://www.w3.org/TeamSubmission/turtle/">Turtle</a> file</p></li></ol><p>Along with Dublin Core properties such as <tt>dc:title</tt> and <tt>dc:description</tt>, RDFa attributes in Newsweek articles store additional RDF metadata using the <a href="http://developers.facebook.com/docs/opengraph">Open Graph</a> vocabulary developed by Facebook. This makes it easier for Facebook to incorporate additional information about news articles in their applications—for example, if people click the Facebook button next to a Newsweek article in order to share it with their Facebook friends.</p><p>It also makes it easier for you to use information about these articles in your own applications. The sample application below just saves the retrieved triples in a file, but you could also pass them to other SPARQLMotion modules that could have OpenCalais analyze the text, combine the triples with data from another source, create a new, specialized RSS feed or <a href="http://topquadrantblog.blogspot.com/2010/05/how-to-publish-your-linked-data-with.html">SPARQL endpoint</a>, or send an email message based on the results of your processing. Retrieving the data is just the beginning.</p><p>To create this application, start by creating a new SPARQLMotion file called <kbd class="userinput">getnewsweektech</kbd>. (For more detailed background on the steps involved in creating and running a SPARQLMotion script, see the PDF tutorial <a href="http://www.topquadrant.com/docs/tbc/AppDevQuickstartGuide.pdf">TopBraid Application Development Quickstart Guide</a>.)</p><p>Create a new SPARQLMotion script in your getnewsweektech.n3 file. For its first module, select <tt>sml:ImportNewsFeed</tt> from the<tt>sml:ImportFromRemoteModules</tt> category and name it <kbd class="userinput">GetNewsweekTechNewsFeed</kbd>. To configure it, you only need to set its <tt>sml:url</tt> value to<kbd class="userinput">http://feeds.newsweek.com/newsweek/technology?format=xml</kbd>, a URL I learned about from <a href="http://www.newsweek.com/company/feeds.html">Newsweek's web page about their RSS feeds</a>.</p><p>Once this module pulls down the RSS data and TopBraid converts it to triples, your script will look through these triples for web page URLs provided as RSS link values and then retrieve the triples that are stored as RDFa in those web pages. The script can't pull the triples from all those web pages at once, so we'll use an IterateOverSelect module to drive the next step. We'll specify a SPARQL SELECT query in the IterateOverSelect module to find the RSS link values, and then for each result that this SELECT query finds, another module will retrieve the triples from the web page named by the link value.</p><p>Drag an <strong>Iterate over select</strong> module from the Control Flow section of the SPARQLMotion palette and name it <kbd class="userinput">GetArticleLinks</kbd>. Paste the following query in as the value for its <tt>sml:selectQuery</tt> property:</p><pre class="pre">PREFIX rss: <http://purl.org/rss/1.0/> <br />SELECT ?articleURLString<br />WHERE {<br /> ?s a rss:item .<br /> ?s rss:link ?articleURL .<br /> LET (?articleURLString := xsd:string(?articleURL)) .<br />}<br /></pre><p>The module that retrieves the RDFa needs a string version of the URL to specify where it should look for the RDFa, so the query above assigns a string version of each <tt>rss:item</tt> resource's <tt>rss:link</tt> value to the variable <tt>?articleURLString</tt>. The script will execute the body of the IterateOverSelect (a separate module that we haven't created yet) once for each value bound to this variable. You're done configuring this module.</p><p>Next, we'll create the body of the IterateOverSelect. This can be a series of modules, but for this application we'll only need one. Drag an<strong>Import RDFa</strong> module from the Import from Remote section of the SPARQLMotion palette and name it <kbd class="userinput">ReadArticleRDFa</kbd>. When configuring this new module, click the white triangle for its <tt>sml:url</tt> property's context menu and select <span class="uicontrol" style="font-weight: bold; ">Add SPARQL expression</span>. This lets you add any combination of SPARQL keywords, symbols, function calls, and operators that returns a single value; for this, all you need here is the variable reference <tt>?articleURLString</tt>. Each time this module retrieves triples from the RDFa in the web page at this URL, it will pass along the triples that it found to the next module. If this module has an <tt>sml:needsTidy</tt> property, set it to True to make it easier to read RSS that isn't well-formed XML.</p><p>For our script's last module, drag an <strong>Export to RDF File</strong> module from the palette's Export to Local section and call it <kbd class="userinput">SaveArticleTriples</kbd>. Set its <tt>sml:targetFilePath</tt> value to <kbd class="userinput">newsweekTech.n3</kbd>; it will write this file to the directory that holds the SPARQLMotion file with your script. Set the module's <tt>sml:baseURI</tt> to <kbd class="userinput">http://example.com/newsweek/tech/metadata</kbd> or to any URI that you like.</p><p>All that's left is to connect up the four modules as shown below. When you add a connector out of your Get Article Links <strong>Iterate Over Select</strong>module, TopBraid Composer will ask you whether your new connector is pointing at the body of the loop (the part to execute for each binding of the selected variable) or at the module that should take control of the script when the iteration is finished. Connect Get Article Links to the Read Article RDFa module with an <tt>sm:body</tt> link, because that's the part we want executed for each iteration, and connect Get Article Links to Save Article Triples with an <tt>sm:next</tt> link to transfer control (and the collected triples) there when the iteration is all done.</p><img src="http://www.snee.com/bobdc.blog/img/tq/rssrdfa1.jpg" alt="" /><p>Select the Save Article Triples module and click the green triangle at the top of the workspace to execute the script up to that final module, and you should end up with a newsweekTech.n3 file in the same directory as your getnewsweektech.n3 file that holds the script. This new file will hold triples extracted from the various web pages named in the Newsweek tech news feed.</p><p>To branch out, you could substitute the names of <a href="http://www.newsweek.com/company/feeds.html">other Newsweek feeds</a>, or additional ones, and then collect all the triples together. You could drive the whole thing with a TopBraid Ensemble interface where an end user picks the category of Newsweek news (for example, their technology, politics, business, or entertainment categories) whose metadata should be retrieved. You could also find other publications that store RDFa metadata in their articles, or other websites, such as <a href="http://topquadrantblog.blogspot.com/2009/12/rdfa-on-topquadrantcom.html">TopQuadrant's</a>. And, as I mentioned earlier, you could combine this with other features of SPARQLMotion and TopBraid to make a very powerful application.</p></span>Bob DuCharmehttp://www.blogger.com/profile/02742075186312518829noreply@blogger.com0tag:blogger.com,1999:blog-7507012841435012041.post-58279002629652957702010-08-16T07:24:00.000-07:002010-08-16T07:32:29.827-07:00How to: Find SKOS constraint violations in AGROVOC with SPARQL Rules<span class="Apple-style-span" style=" ;font-family:arial, helvetica;font-size:13px;"><h1 id="id103287" style=" font-weight: bold; font-family:arial, helvetica;font-size:24px;"><span class="Apple-style-span" style="font-weight: normal; font-size:-webkit-xxx-large;"><span class="Apple-style-span" style=" ;font-size:13px;"><p id="id103292" style="font-family: arial, helvetica; font-size: 10pt; "></p><h1 id="id103287" style=" font-weight: bold; font-family:arial, helvetica;font-size:24px;"><span class="Apple-style-span" style="font-weight: normal; font-size:13px;">The <a id="id103296" href="http://www.w3.org/TR/#tr_SKOS">Simple Knowledge Organization System</a> (SKOS) vocabulary management specification is gaining popularity because, as a standard, it makes it easier to share taxonomies and thesaurii between different systems. It also guards investments in vocabulary development against the potential problems of dependence on a proprietary vendor format.</span></h1><div id="id103289"><p id="id103310" style="font-family: arial, helvetica; font-size: 10pt; ">The W3C makes an <a id="id103312" href="http://www.w3.org/2004/02/skos/core.rdf">OWL ontology</a> for SKOS available, which makes it easier to ensure that your vocabulary conforms to the standard. As a comment near the beginning of it tells us, though,</p><blockquote id="id103324" style="font-family: arial, helvetica; font-size: 10pt; ">A number of semantic conditions are *not* expressed formally in this schema. These are:<br /><br />S12<br />S13<br />S14<br />S27<br />S36<br />S46<br /><br />For the conditions listed above, rdfs:comments are used to indicate the conditions.<br /></blockquote><p id="id103358" style="font-family: arial, helvetica; font-size: 10pt; ">The comment for <a id="id103361" href="http://www.w3.org/TR/2009/REC-skos-reference-20090818/#L1567">S13</a> says that "skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise disjoint properties". In plain English, this means that for a given concept, you can't use the same term for any two of these properties. For example, you shouldn't say that "dog" is both the preferred label and the alternate label for a given concept—it should be one or the other.</p><p id="id103380" style="font-family: arial, helvetica; font-size: 10pt; ">If these constraints are in the ontology as comments and not as something that can be implemented by executable code, how do you find violations of these constraints? The simplest way I've found is to use SPARQL Constraints (with SPIN). We've built on <a id="id103387" href="http://composing-the-semantic-web.blogspot.com/2010/04/where-owl-fails.html">Paul Hermans' work</a> to implement these constraints in the ontology at <a id="id103396" href="http://topbraid.org/spin/skosspin">http://topbraid.org/spin/skosspin</a>. It imports the W3C SKOS ontology and adds one rule to the skos:OrderedCollection class for constraint S36 and rules for the other five constraints to the skos:Concept class. For example, it adds the following three rules for constraint S13:</p><pre id="id103408"># Constraint S13: skos:prefLabel, skos:altLabel and skos:hiddenLabel <br /># are pairwise disjoint properties.<br />ASK WHERE {<br /> ?this skos:prefLabel ?label .<br /> ?this skos:altLabel ?label .<br />}<br /><br />ASK WHERE {<br /> ?this skos:prefLabel ?label .<br /> ?this skos:hiddenLabel ?label .<br />}<br /><br />ASK WHERE {<br /> ?this skos:hiddenLabel ?label .<br /> ?this skos:altLabel ?label .<br />}</pre><p id="id103429" style="font-family: arial, helvetica; font-size: 10pt; ">If any of these returns a boolean true, then we know that constraint S13 has been violated. (If you look at the skosspin ontology, you'll see these queries represented as triples, which is more difficult to read but easier to implement than rules expressed as SPARQL queries as shown above. TopBraid Composer can convert between the two formats, and so can a <a id="id103437" href="http://sparqlpedia.org/spinrdfconverter.html">SPARQL Text to SPIN RDF Syntax Converter</a> that Holger Knublauch has made available on the web.)</p><p id="id103447" style="font-family: arial, helvetica; font-size: 10pt; ">I tested this with the Food and Agriculture Organization of the United Nation's popular <a id="id103451" href="http://aims.fao.org/website/AGROVOC-Thesaurus/sub">AGROVOC</a> thesaurus, a vocabulary "designed to cover the terminology of all subject fields in agriculture, forestry, fisheries, food and related domains", and found over 1600 violations of constraint S13. Because this thesaurus has almost 29,000 concepts and preferred and alternate labels in multiple languages for most concepts, it's easier to violate these constraints than you might think, and I never would have found them without the ability to automate this search. For example, concept http://www.fao.org/aos/agrovoc#c_1135 has an English preferred label of "Buds", 14 preferred labels for other languages such as Farsi and Thai, and 24 alternate labels. Among these, the Slovak skos:prefLabel value and the Sloval skos:altLabel value are both "púèiky", so this concept violates constraint S13.</p><p id="id103485" style="font-family: arial, helvetica; font-size: 10pt; ">How do we find the violations? I tried it with the free edition of TopBraid Composer, because it has everything you need to define and use SPARQL Rules. (TopBraid Composer Maestro Edition's ability to use these rules from within applications has made it possible for me to add several nice features to applications for some of our clients.)</p><p id="id103495" style="font-family: arial, helvetica; font-size: 10pt; ">The screenshot below of TopBraid Composer's <b id="id103498">Navigator</b> and <b id="id103502">Imports</b> views shows that I created a checkAGROVOC project and added a checkAGROVOC.n3 ontology file to it. This ontology only does two things: it imports the ag_skos_080422.rdf file that I <a id="id103509" href="ftp://ftp.fao.org/gi/gil/gilws/aims/kos/agrovoc_formats/skos/">downloaded from the fao.org web site</a> and it imports the skosspin ontology described above for its SPARQL Rules. (It imports a web version of the skosspin ontology and, because of its 62 meg size, the local copy of the actual AGROVOC thesaurus.)</p><img id="id103518" src="http://www.snee.com/bobdc.blog/img/tq/agrovoc1.jpg" width="590" /><p id="id103527" style="font-family: arial, helvetica; font-size: 10pt; ">With these two files imported, I opened TopBraid Composer's <b id="id103530">Problems</b> view and clicked that view's "Refresh all problems of current TopBraid file" icon <img id="id103536" src="http://www.snee.com/bobdc.blog/img/tq/agrovoc3.jpg" />. A "Progress Information" message box told me that TopBraid Composer was "Checking SPIN constraints on skos:Concept", which took a few minutes because there were plenty to check.</p><p id="id103546" style="font-family: arial, helvetica; font-size: 10pt; ">After it finished checking, the <b id="id103549">Problems</b> view said that there were Warnings and had a plus sign that I expanded to see the first few constraint violations:</p><img id="id103557" src="http://www.snee.com/bobdc.blog/img/tq/agrovoc4.jpg" width="590" /><p id="id103565" style="font-family: arial, helvetica; font-size: 10pt; ">(You may want to play with the column widths a bit, because the <b id="id103567">Location</b> column is the one you really want to see.) Double-clicking anywhere on a specific warning line shows the details about that concept on the Resource Form, like this:</p><img id="id103572" src="http://www.snee.com/bobdc.blog/img/tq/agrovoc5.jpg" width="590" /><p id="id103580" style="font-family: arial, helvetica; font-size: 10pt; ">If you don't see the little yellow warning symbols on the Resource Form that show where the problems are, click the little "Display constraint violation warnings" icon at the top of TopBraid Composer <img id="id103586" src="http://www.snee.com/bobdc.blog/img/tq/agrovoc2.jpg" />. In this case, a bit of scrolling down when viewing concept c_1002 shows that the same term appears as both Hungarian skos:altLabel and skos:prefLabel property values for this concept.</p><p id="id103597" style="font-family: arial, helvetica; font-size: 10pt; ">The <b id="id103599">Problems</b> view above only shows the first 100 of the 2,972 warnings. Clicking the context menu white triangle in the view's upper-right lets you configure Preferences for the view so that you can reset the number of items to be displayed; I had no problem with a figure of 3,000.</p><p id="id103609" style="font-family: arial, helvetica; font-size: 10pt; ">Now that we know what constraint has been violated, there are other ways to list the concepts that need to be corrected. For example, the following query in TopBraid Composer's <b id="id103615">SPARQL</b> view lists the identifiers that have the same label for these two properties:</p><pre id="id103621" style="margin-top: 14pt; margin-bottom: 14pt; margin-left: 14pt; ">SELECT ?s ?label<br />WHERE {<br /> ?s skos:prefLabel ?label . <br /> ?s skos:altLabel ?label . <br />}</pre><p id="id103628" style="font-family: arial, helvetica; font-size: 10pt; ">Once you execute this query you can export its results to a file and then use that as a reference point to address the issues in the vocabulary.</p><p id="id103634" style="font-family: arial, helvetica; font-size: 10pt; ">We could have started off by executing this query on the AGROVOC SKOS file, but remember, at the time we didn't know which constraints had been violated. Using SPARQL Rules as extra metadata for class definitions helps to automate the identification of quality issues with the data, letting us use other techniques to focus on the specific problems and how to fix them.</p><p id="id103650" style="font-family: arial, helvetica; font-size: 10pt; ">Are your SKOS vocabularies violating any of the six extra constraints described in the SKOS specification? As I mentioned, this all works with the free version of TopBraid Composer, which is available for Windows, Mac, and Linux, so you can try it yourself to find out. With the TopBraid Composer Maestro edition, you can build applications for end users who can then maintain these vocabularies with a web-based interface instead of using TopBraid Composer. The user interface for notification of constraint violations then becomes one of the many things you can customize to the needs of your end users. You can also define new constraints around your own shop's business rules—for example, to require that all labels begin with an upper-case letter—and you can set TopBraid Composer or your application to highlight these violations as soon as they occur, instead of checking in batch mode like I did above.</p><p id="id103677" style="font-family: arial, helvetica; font-size: 10pt; ">To summarize, what we've seen here is really just a starting point, and there are all kinds of places where you can take it to improve the consistency and value of your vocabularies.</p></div><p></p></span></span></h1></span>Bob DuCharmehttp://www.blogger.com/profile/02742075186312518829noreply@blogger.com1tag:blogger.com,1999:blog-7507012841435012041.post-77331497694761421732010-07-27T06:38:00.000-07:002010-07-27T06:45:36.786-07:00How to: use the SPARQLMotion debugger<span class="Apple-style-span" style=" ;font-family:Arial, Helvetica, sans-serif;font-size:medium;"><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Since release 3.3, TopBraid Composer has included an interactive debugger for SPARQLMotion scripts that can make your development go much faster. TopQuadrant VP of Product Development Holger Knublauch wrote a nice <a href="http://composing-the-semantic-web.blogspot.com/2010/03/sparqlmotion-debugger.html" style="color: rgb(51, 51, 51); ">overview of the debugger's features</a> in his blog; below is a short hands-on tutorial in the use of the debugger.</p><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">We're going to put together a short SPARQLMotion script with a problem that prevents it from running properly. Experienced SPARQLMotion developers may notice the problem when we add it, but leave it in there—we'll see how the SPARQLMotion debugger helps us locate it.</p><div class="section" style="margin-top: 1em; margin-bottom: 1em; "><h2 class="sectiontitle" style="font-size: 1.17em; font-weight: bold; color: black; margin-bottom: 0em; padding-bottom: 0px; font-variant: normal; line-height: 22px; margin-top: 1em; padding-top: 0px; ">Creating our script</h2><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Our script will prompt the user for a string to search for and then list the first and last names of everyone in the sample kennedy data file included with TopBraid Composer who has that string as part of their first name.</p><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">First, create a new SPARQLMotion file and give it a base URI of http://www.topquadrant.com/debugdemo and a file name of debugdemo. (For a more detailed description of how to create a SPARQLMotion file, see the "Creating and running a SPARQLMotion script" chapter of the <a href="http://www.topquadrant.com/docs/tbc/AppDevQuickstartGuide.pdf" style="color: rgb(51, 51, 51); ">TopBraid Application Development Quickstart Guide</a>.)</p><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Once your new file is open, create the script by selecting <span class="uicontrol" style="font-weight: bold; ">Create SPARQLMotion Script</span> from the TopBraid Composer <span class="uicontrol" style="font-weight: bold; ">Scripts</span> menu, and for its initial module type select sml:EnterLiteral. This is the module that will ask the user to enter a query string, and you'll find it under sml:ImportModules -> sml:ImportFromVariousModules. For the name of your new module instance, enter <kbd class="userinput">GetQueryString</kbd>. Click the <span class="uicontrol" style="font-weight: bold; ">OK</span> button and you'll see your script on the SPARQLMotion workspace with its one module.</p><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Double-click the GetQueryString module icon and enter <kbd class="userinput">queryString</kbd> as the sm:outputVariable value and <kbd class="userinput">Enter query string</kbd> as the sml:text value. When the script runs, this module will display a message box that prompts the user with this message. After the user enters a value into the field on that message box, the value will be stored in the variable <tt>queryString</tt> for use by later modules in the script. You are now done configuring this module.</p><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">There are two more modules to add. Drag an <span class="uicontrol" style="font-weight: bold; ">Import RDF From Workspace</span> module from the <span class="uicontrol" style="font-weight: bold; ">Import from Local</span> section of the SPARQLMotion palette onto your workspace and name it <kbd class="userinput">GetKennedysData</kbd>. Double-click it to configure it, and set the sml:sourceFilePath value to <kbd class="userinput">/TopBraid/Examples/kennedys.rdf</kbd>. For the third and final module, drag an <span class="uicontrol" style="font-weight: bold; ">Apply Construct</span> module from the <span class="uicontrol" style="font-weight: bold; ">RDF Processing</span> section of the Palette and name it <kbd class="userinput">FindMatchingNames</kbd>. Set its sml:replace value to true so that the module passes along only the triples that it creates. Set its sml:constructQuery property to the following query:</p><pre class="pre">PREFIX k: <http://topbraid.org/examples/kennedys#><br />CONSTRUCT { <br /> ?s k:firstName ?first . <br /> ?s k:lastName ?last .<br />} WHERE { <br /> ?s k:firstName ?first . <br /> ?s k:lastName ?last . <br /> FILTER regex(?first, ?searchString, "i") .<br />} </pre><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">(Instead of setting the prefix for the kennedys data at the beginning of this query, you could also do it on the script file's Ontology Overview screen.) This query passes along the firstName and lastName triples for anyone in the data file who has the value of the <tt>searchString</tt> as part of their firstName value. (The "i" provided as the third parameter to the regex() function tells it to do a case-insensitive comparison.)</p><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Connect up the three modules so that the script look like this:</p><br /><img src="http://www.snee.com/bobdc.blog/img/tq/debugger1.jpg" alt="" /><br /><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">To test the script, select the FindMatchingNames module and click the green arrow at the top of your workspace to run all the modules up to the selected one. When the GetQueryString module displays a message box asking you for a query string value, enter <kbd class="userinput">Carol</kbd>.When the script finishes running and you see the <span class="uicontrol" style="font-weight: bold; ">SPARQLMotion Script Executed</span> message box, make sure that the <span class="uicontrol" style="font-weight: bold; ">Display result triples</span> checkbox is checked before continuing so that you can see what data the script found.</p><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Although the kennedys data includes a Caroline and a Carolyn, you won't see any triples in the <span class="uicontrol" style="font-weight: bold; ">SPARQLMotion Results</span> view when the script is finished running. Let's use the debugger to find out why.</p></div><div class="section" style="margin-top: 1em; margin-bottom: 1em; "><h2 class="sectiontitle" style="font-size: 1.17em; font-weight: bold; color: black; margin-bottom: 0em; padding-bottom: 0px; font-variant: normal; line-height: 22px; margin-top: 1em; padding-top: 0px; ">Using the debugger</h2><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">The small blue circle icon at the top of your SPARQLMotion workspace <img src="http://www.snee.com/bobdc.blog/img/tq/debugger2.jpg" alt="" /> toggles whether the selected icon is a debug breakpoint. On the SPARQLMotion workspace, make sure that your FindMatchingNames module is selected and then click that small blue circle. This will add a blue circle to the module icon to indicate that it is now a breakpoint. You can set as many modules you like as breakpoints, but for this exercise we'll just set this one.</p><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Click the green arrow to run the script again, enter "Carol" as the query string. When the script reaches the module with the breakpoint, it displays the debugger window:</p><br /><img src="http://www.snee.com/bobdc.blog/img/tq/debugger3.jpg" width="590" alt="" /><br /><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">The left part of the window has the Execution Plan, which lists the modules in the order that they will be executed, with a check mark next to each module that's been set as a break point. As you debug, you're free to check and uncheck any of these. The bottom of the window displays the arguments to the module and their values, and the top shows three tabs: <span class="uicontrol" style="font-weight: bold; ">Variables</span>, <span class="uicontrol" style="font-weight: bold; ">Query</span>, and <span class="uicontrol" style="font-weight: bold; ">Input Graph</span>. Let's start with the last tab: click <span class="uicontrol" style="font-weight: bold; ">Input Graph</span>.</p><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">On the tab's <span class="uicontrol" style="font-weight: bold; ">Input Graph</span> panel, click the plus sign, and you'll see the that kennedys data is definitely being provided as input to the FindMatchingNames module. Click that line, as shown below, and you'll see some of its data appear in the lower panel. Scrolling down there shows that CarolineKennedy and CarolynBessette are in the data being passed along, so we can't blame our script's retrieval of data for its inability to show the expected results.</p><br /><img src="http://www.snee.com/bobdc.blog/img/tq/debugger4.jpg" width="590" alt="" /><br /><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Now select the debugger window's <span class="uicontrol" style="font-weight: bold; ">Query</span> tab. This lets you execute test queries on the data passed to the module. Because FindMatchingNames is an Apply Construct module, the default query shown on the Query tab is a SELECT version of the CONSTRUCT query that you entered when you created this module.</p><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">You can enter any SELECT query you want in in this panel of the debugger window and run it without affecting the state of the running script. Commenting and uncommenting lines of this query and then re-running it is a particularly valuable technique for exploring what information is available to your SPARQLMotion script at this point in its execution and what your application logic has done with that data.</p><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Perhaps the problem is in the query's FILTER expression. Add a pound sign at the beginning of that line to comment it out, and click the green triangle in the upper-right to run the SELECT query shown in the debugger window. You'll see plenty of <tt>s</tt>, <tt>first</tt>, and <tt>last</tt> values appear in the lower panel, including Caroline Kennedy and Carolyn Bessette, so it looks like a problem in the FILTER expression prevented the query from passing along the requested data. The <tt>?first</tt> variable is clearly being set properly, because we saw plenty of output when we commented out this line, so maybe the problem is with the <tt>?searchString</tt> variable referenced in the FILTER line's regex() function call.</p><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Click the debugger window's <span class="uicontrol" style="font-weight: bold; ">Variables</span> tab to display it, and you'll see the problem: the GetQueryString module stored the entered value in a variable called <tt>queryString</tt>, and the query's FILTER expression was checking values against a non-existent <tt>searchString</tt> variable. (In a real debugging session, the <span class="uicontrol" style="font-weight: bold; ">Variables</span> tab is probably the first one you'd check, which is why it displays first.) Go back to the <span class="uicontrol" style="font-weight: bold; ">Query</span> tab, uncomment the FILTER line, change ?searchString to ?queryString, and click the green arrow. You should now see Caroline Kennedy and Carolyn Bessette and no one else show up under the query in lower part of the debugger window.</p><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">At this point, you've only fixed the debugger window's temporary query used to explore the workings of the script, and the application itself still needs to be fixed. Click the<span class="uicontrol" style="font-weight: bold; ">Continue</span> button to resume execution of the script past the breakpoint. If there were more modules and any of them were set as break points, the <span class="uicontrol" style="font-weight: bold; ">Continue</span> button would stop at each one and display the debugger window, but your script has no more breakpoints. (If there were more modules after FindMatchingNames module, the <span class="uicontrol" style="font-weight: bold; ">Step Into</span> button would execute them one at a time so that you could review the three debugger tabs for information about those modules as they executed.) Once the script completes, change <tt>?searchString</tt> to <tt>?queryString</tt> in the FindMatchingNames module's query, click the debugger breakpoint icon while the FindMatchingNames icon is selected to turn off its breakpoint indicator, and run the query again with the same "Carol" input string. It should run with the expected results appearing in the<span class="uicontrol" style="font-weight: bold; ">SPARQLMotion Results</span> view.</p></div><div class="section" style="margin-top: 1em; margin-bottom: 1em; "><h2 class="sectiontitle" style="font-size: 1.17em; font-weight: bold; color: black; margin-bottom: 0em; padding-bottom: 0px; font-variant: normal; line-height: 22px; margin-top: 1em; padding-top: 0px; ">Debugging your own applications</h2><p style="margin-top: 6pt; margin-right: 0px; margin-bottom: 8pt; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Although we ran this SPARQLMotion script from within the SPARQLMotion editor, you can still set breakpoints and check all the same information about a SPARQLMotion script that is invoked from somewhere else—for example, from a TopBraid Ensemble Application or a from web service. (This assumes that the script is running under the TopBraid Live Personal Edition Server included with the TopBraid Composer Maestro Edition, which you use to develop these scripts.) This makes the debugger invaluable for just about all kinds of TopBraid development, and you'll find more uses for it as you use it more. Again, review <a href="http://composing-the-semantic-web.blogspot.com/2010/03/sparqlmotion-debugger.html" style="color: rgb(51, 51, 51); ">Holger's blog posting</a> for additional ideas.</p></div></span>Bob DuCharmehttp://www.blogger.com/profile/02742075186312518829noreply@blogger.com0tag:blogger.com,1999:blog-7507012841435012041.post-27231305554978962962010-05-07T08:36:00.000-07:002010-05-13T09:55:11.483-07:00How to: Publish your Linked Data with TopBraid Live SPARQL Endpoints<div>SPARQL endpoints are an increasingly popular way to expose linked data. Invoking SPARQL Endpoints from TopBraid Composer's SPARQL view was the subject of a previous <a href="http://topquadrantblog.blogspot.com/2010/02/how-to-get-data-from-sparql-endpoints.html">TQ blog on SPARQL Endpoints</a>.In this entry we will discuss how TopBraid Live can be used to <i>implement</i> a SPARQL Endpoint using TopBraid Live. SPARQL Endpoints are Web services that conform to the <a href="http://www.w3.org/TR/rdf-sparql-protocol/">SPARQL protocol</a>. SPARQL queries are passed to a URL where a SPARQL service processes the query and returns results in a defined XML format. A number of SPARQL Endpoints exist for Web data (see the <a href="http://esw.w3.org/topic/SparqlEndpoints" target="_blank">W3C list of current SPARQL Endpoints</a>) and have become important sources for linked data.<br /><br />A SPARQL Endpoint service implementation is packaged with TopBraid Live and is available out-of-the box for both TopBraid Live Personal Server (TopBraid Composer-ME running on localhost:8083), and TopBraid Live Enterprise Server (for more information, see <a href="http://www.topquadrant.com/products/TB_Live.html" target="_blank">TBL Home page</a>). Creating a SPARQL Endpoint for your data is therefore an easy three-step process:<br /><ol><li>Load the model you wish to query into your TBL/TBC-ME workspace.</li><li>Use the GRAPH SPARQL keyword to access any named graph in the workspace.</li><li>Send a SPARQL query in the query string of a url that access the TBL SPARQL endpoint.</li></ol><p>For example, if you have TBC-ME running, the TopBraid Live Personal Server is automatically available. Open a browser window and enter the following URL:</p><pre>http://localhost:8083/tbl/sparql?query=SELECT DISTINCT ?p WHERE {GRAPH <http://topbraid.org/countries> {?s ?p ?o} }<br /></pre><p>This URL passes a query string that is applied to the specified graph, the countries.owl example included in the TopBraid library. The query is passed to TopBraid Live and executed using TBL's SPARQL engine. The results are converted to the SPARQL Endpoint format and returned via HTTP. The above URL specifies the TBL Personal Server (via TBC-ME's localhost:8083) as the endpoint. If you have <a href="http://www.topquadrant.com/products/TB_Live.html" target="_blank">TopBraid Live Enterprise Edition</a> running on a server, just substitute the server address for your Enterprise server.</p><p>To further explore the ease of creating SPARQL Endpoints with TopBraid Live,<br /><a href="http://www.topquadrant.com/products/FAQ_Examples/LiveSPARQLendpoint.html" target="_blank">click here</a> to access a page that defines an HTML form that submits a query to the TBL Personal Server SPARQL Endpoint. Copy and paste the following queries that use some of the example models included in the TopBraid library.</p><p>This query finds all countries and their abbreviations from the countries model in TopBraid/Examples:<br /></p><pre># Get all countries and abbreviations from countries model<br />PREFIX countries: <http://topbraid.org/countries#><br />PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#><br />SELECT ?name ?abbrev<br />WHERE<br />{ GRAPH <http://topbraid.org/countries><br /> { ?country a countries:Country .<br /> ?country rdfs:label ?name .<br /> ?country countries:abbreviation ?abbrev .<br /> }<br />}<br /></pre><p>This query finds all children of Joseph Kennedy from the kennedys model in TopBraid/Examples:<br /></p><pre># Find Joe Kennedy's children in kennedys model<br />PREFIX k: <http://topbraid.org/examples/kennedys#><br />SELECT ?cname<br />WHERE<br />{ GRAPH <http://topbraid.org/examples/kennedys><br /> { k:JosephKennedy k:child ?child .<br /> ?child k:name ?cname .<br /> }<br />}<br /></pre><p>Again, substitute your Live server address for "localhost:8083" in the action tag of the HTML file to apply queries to your Live server.</p></div><div class="section"><h2 class="sectiontitle">Using SPIN functions in SPARQL Endpoints</h2><p>TopBraid SPARQLMotion Functions and user-defined <a href="http://topquadrant.com/products/SPIN.html">SPIN</a> functions registered in a Live workspace can also be used in SPARQL Endpoint queries. For example, the following query uses the TopBraid SPARQLMotion Function smf:if() to compute the age of all persons at death or their current age using the example kennedys model. Instead of returning variable bindings via SELECT, this query returns a RDF graph via CONSTRUCT. Since the graph is in RDF/XML format, the file returned by the endpoint can easily be imported into existing RDF/OWL models.<br /></p><pre># infer age at death or age as of 2010<br />PREFIX k: <http://topbraid.org/examples/kennedys#><br />PREFIX smf: <http://topbraid.org/sparqlmotionfunctions#><br />CONSTRUCT {?person k:age ?age}<br />WHERE<br />{ GRAPH <http://topbraid.org/examples/kennedys><br /> { ?person k:birthYear ?byear .<br /> OPTIONAL {?person k:deathYear ?dyear}<br /> LET (?age := smf:if(bound(?dyear), ?dyear-?byear, 2010-?byear))<br /> }<br />}<br /></pre><p>Note that the age computation is hardcoded for 2010. A SPARQL query that returns the current year can be defined with a few statements. An example is shown in the kennedysSPIN model in the TopBraid Library, see TopBraid/Examples/kennedysSPIN.rdf in the Composer workspace. If you look at the SPIN function getCurrentYear (defined as a subclass of spin:Functions, which is a subclass of spin:Modules), it finds the current year as the first four characters returned in xsd:dateTime format returned from the function afn:now().</p><p>Instead of copying this code into the query, let's register this as a SPIN function so it can be called by any model in the workspace, including SPARQL Endpoints. Do the following:</p><ol><li>Re-name the file kennedysSPIN.rdf to kennedysSPIN.spin.rdf. Adding the .spin extension registers all of the SPIN functions in this model with the workspace, allowing SPIN functions to be called without importing or opening the files.</li><br /><li>From the TBC-ME menu, select Scripts > Refresh/Display SPARQLMotion functions... This will register the functions for the current session. When Live or Composer is started, the system will scan the files in the workspace for .spin files and register all functions. The extra step is needed here only if the file name was changed without stopping the Composer session. A Deploy (Export... Deploy in Composer) to a Live server will automatically refresh scripts.</li></ol><p>Now try the same query with the following changes:<br /></p><pre># infer age at death or age from current year<br />PREFIX k: <http://topbraid.org/examples/kennedys#><br />PREFIX smf: <http://topbraid.org/sparqlmotionfunctions#><br /><b>PREFIX kspin: <http://topbraid.org/examples/kennedysSPIN#></b><br />CONSTRUCT {?person k:age ?age}<br />WHERE<br />{ GRAPH <http://topbraid.org/examples/kennedys><br /> { ?person k:birthYear ?byear .<br /> OPTIONAL {?person k:deathYear ?dyear}<br /> LET (?age := smf:if(bound(?dyear), ?dyear-?byear, <b>kspin:getCurrentYear()</b>-?byear))<br /> }<br />}<br /></pre><p>Note the use of the user-defined SPIN function getCurrentYear(). This feature can be used to call any SPIN function including those that are defined by SPARQLMotion scripts. This raises the potential of using SPARQL endpoints for a wide range of processing capabilities, including importing models from outside of a Live workspace, processing triples before querying, applying queries to inference results, integrating models from different file types, and other kinds of SPARQL and RDFS/OWL processing. For example, a SPARQL Endpoint request could call a SPARQLMotion script that runs standard RDFS or OWL inferences before submitting the query, thus returning results from both inferred and asserted triples.</p></div><div class="section"><h2 class="sectiontitle">Advanced SPARQL Protocol: Federated SPARQL Queries</h2><p>The SPARQL SERVICE keyword sends a query to remote service endpoint. Since TopBraid Live supports the SERVICE keyword, SPARQL endpoint queries to TopBraid Live can call other SPARQL Endpoints! Try the following query in the <a href="http://www.topquadrant.com/products/FAQ_Examples/LiveSPARQLendpoint.html"target="_blank">example query form</a>.</p><pre><br />PREFIX k: <http://topbraid.org/examples/kennedys#><br />PREFIX smf: <http://topbraid.org/sparqlmotionfunctions#><br />CONSTRUCT {?child k:birthDate ?birthdate}<br />WHERE<br />{ GRAPH <http://topbraid.org/examples/kennedys><br /> { k:RoseFitzgerald k:child ?child .<br /> ?child k:firstName ?fname .<br /> ?child k:lastName ?lname .<br /> ?child k:gender k:female .<br /> ?child k:spouse ?spouse .<br /> ?spouse k:lastName ?slname .<br /> LET (?dbpRsc := smf:buildURI("http://dbpedia.org/resource/{?fname}_{?lname}_{?slname}"))<br /><br /> <b>SERVICE <http://dbpedia.org/sparql><br /> { ?dbpRsc <http://dbpedia.org/ontology/Person/birthDate> ?birthdate .<br /> } .</b><br /> }<br />}<br /></pre><p>This query is applied to the kennedys example model to query for female children of Rose Fitzgerald and sends a query to the <a href="http://dbpedia.org/">DBPedia</a> SPARQL Endpoint to find their birth dates. The buildURI() function will generate a URI that is known in DBPedia, such as <http://dbpedia.org/resource/Eunice_Kennedy_Shriver>. The results from DBPedia bind the birth date to ?birthdate, which is returned in the TopBraid Live SPARQL endpoint response. As long as DBPedia is up and running, the result federates data from two SPARQL Endpoints, realizing the potential of linked data sources.</p></div><div class="section"><h2 class="sectiontitle">Conclusions</h2><p>SPARQL endpoints are a complement to TopBraid Live's ability to create<br /><a href="http://topquadrantblog.blogspot.com/2010/01/how-to-create-and-run-semantic-web.html">RESTful Web services</a>. While Web services are more flexible, allowing data to be returned in any text-based format, SPARQL endpoints can be used in a variety of applications expecting SPARQL result sets in an XML format. TopBraid Live significantly improves on existing SPARQL Endpoints with capabilities to federate queries and design functions and scripts that process data for external usage.</p><p>These examples demonstrate the power of TopBraid Live as an RDF back-end. Using a straightforward HTML form, one can access to full power of TopBraid Live and advanced SPARQL queries. These examples can be directly applied against the Personal Server version of TopBraid Live, packaged in TopBraid Composer-Maestro Edition (TBC-ME), which is freely available for a 30-day trial. TopBraid Live Enterprise Edition is deployed as a Tomcat servlet for Web-enabled access. For more information, see the <a href="http://www.topquadrant.com/products/TB_Live.html">TopBraid Live</a> web page.<br /></p></div>scotthenningerhttp://www.blogger.com/profile/17189585027924210998noreply@blogger.com2