Title: Semantic technologies implementation of a use case, ontology engineering, inference, triple stores,
1Semantic technologies(implementation of a use
case, ontology engineering, inference, triple
stores,)
- Peter Fox (RPI)
- ESIP Summer Meeting
- Santa Barbara CA, 2009, July 7, 1030-1200pm
2Semantic Web Methodology and Technology
Development Process
- Establish and improve a well-defined methodology
vision for Semantic Technology based application
development - Leverage controlled vocabularies, et c.
Adopt Technology Approach
Leverage Technology Infrastructure
Science/Expert Review Iteration
Rapid Prototype
Open World Evolve, Iterate, Redesign, Redeploy
Use Tools
Analysis
Use Case
Develop model/ ontology
Small Team, mixed skills
2
3Semantic Web Layers
http//www.w3.org/2003/Talks/1023-iswc-tbl/slide26
-0.html, http//flickr.com/photos/pshab/291147522/
4Implementation
- Cover language representation choices, and
knowledge engineering - Pull apart the use case
- Tools and services
- Architecture considerations and design choices
5Languages
- OWL (1 and 2)
- RDFS ()
- SKOS
- RIF (OWL 2 RL)
- SPARQL
- OWL-S
6RDFS
- Note XMLS not an ontology language
- Changes format of DTDs (document schemas) to be
XML - Adds an extensible type hierarchy
- Integers, Strings, etc.
- Can define sub-types, e.g., positive integers
- RDFS is recognisable as an ontology language
- Classes and properties
- Sub/super-classes (and properties)
- Range and domain (of properties)
7However
- RDFS too weak to describe resources in sufficient
detail - No localized range and domain constraints
- Cant say that the range of hasChild is person
when applied to persons and elephant when applied
to elephants - No existence/cardinality constraints
- Cant say that all instances of person have a
mother that is also a person, or that persons
have exactly 2 parents - No transitive, inverse or symmetrical properties
- Cant say that isPartOf is a transitive property,
that hasPart is the inverse of isPartOf or that
touches is symmetrical -
- Difficult to provide reasoning support
- No native reasoners for non-standard semantics
- May be possible to reason via First Order
axiomatisation
8RDFS
- Worth taking a look at but there is not a lot of
information readily available (as yet)
9OWL requirements
- Desirable features identified for Web Ontology
Language - Extends existing Web standards
- Such as XML, RDF, RDFS
- Easy to understand and use
- Should be based on familiar KR idioms
- Formally specified
- Of adequate expressive power
- Possible to provide automated reasoning support
10The OWL language
- Three species of OWL
- OWL full is union of OWL syntax and RDF
- OWL DL restricted to FOL fragment (¼ DAMLOIL)
- OWL Lite is easier to implement subset of OWL
DL - Semantic layering
- OWL DL ¼ OWL full within DL fragment
- DL semantics officially definitive
- OWL DL based on SHIQ Description Logic
- In fact it is equivalent to SHOIN(Dn) DL
- OWL DL Benefits from many years of DL research
- Well defined semantics
- Formal properties well understood (complexity,
decidability) - Known reasoning algorithms
- Implemented systems (highly optimized)
11(No Transcript)
12OWL 1 Class Constructors
13OWL 1 axioms
14OWL 2
- http//www.w3.org/2007/OWL/wiki/OWL_Working_Group
- http//www.w3.org/2007/OWL/wiki/ImageOwl2-refcard
_2008-09-24.pdf - Semtech slides from the W3 OWL 2 panel ask me
for these - Property chaining
- Numerics
15OWL 2 RL
- http//www.w3.org/TR/owl2-profiles/
- http//ivan-herman.name/2009/04/27/simple-owl-2-rl
-service/
16SKOS properties
- skosnote
- e.g. Anything goes.
- skosdefinition
- e.g. A long curved fruit with a yellow skin and
soft, sweet white flesh inside. - skosexample
- e.g. A bunch of bananas.
- skosscopeNote
- e.g. Historically members of a sheriff's retinue
armed with pikes who escorted judges at assizes. - skoshistoryNote
- e.g. Deleted 1986. See now Detention,
Institutionalization (Persons), or
Hospitalization. - skoseditorialNote
- e.g. Confer with Mr. X. re deletion.
- skoschangeNote
- e.g. Promoted love to preferred label, demoted
affection to alternative label, Joe Bloggs,
2005-08-09.
17SKOS core and RDFS/OWL
- Disjoint?
- Should skosConcept be disjoint with
- rdfProperty ?
- rdfsClass ?
- owlClass ?
- DL?
- Should SKOS Core be an OWL DL ontology?
- Means not allowing flexibility in range of
documentation props - It is now (2008)! OWL-Full
18Summaries
- Michael Dennys Table (a bit out of date)
- http//www.xml.com/2004/07/14/examples/Ontology_Ed
itor_Survey_2004_Table_-_Michael_Denny.pdf - ESW Wiki http//esw.w3.org/topic/SemanticWebTools
19Engineering an ontology to the ground
20Editors
- Protégé (http//protégé.stanford.edu)
- SWOOP (http//mindswap.org/2004/SWOOP see also
http//www.mindswap.org/downloads/) - Altova SemanticWorks (http//www.altova.com/downlo
ad/semanticworks/semantic_web_rdf_owl_editor.html)
- SWeDE (http//owl-eclipse.projects.semwebcentral.o
rg/InstallSwede.html), goes with Eclipse - Medius
- TopBraid Composer and other commercial tools
- CMAP Ontology Editor (COE) (http//cmap.ihmc.us/co
e)
21Protégé
- http//protege.stanford.edu/
- http//protegewiki.stanford.edu/index.php/Protege-
OWL - Please check version compatibility when choosing
your development otions. E.g. 3.4 v. 4.0 - Do you have plugins you like? They may not yet be
available in 4.0 - e.g. Prompt not compatible with version 4.0)
22Triple Stores
- Jena (http//jena.sourceforge.net/)
- SeSAME/SAIL (http//www.openrdf.org/)
- KOWARI (http//www.kowari.org/) -gt
- Mulgara (http//www.mulgara.org/)
- Redland (http//librdf.org/index.html)
- Oracle (!)
- Many others (relational, object-relational)
23Software development tools
- Protégé, w/ plug-ins - some better than others
- SWOOP (OWL analyzer species validator,
partitioner) - Jena (http//jena.sourceforge.net/)
- ELMO ()
- Eclipse (full integrated development environment
for Java http//www.eclipse.org/) - Top Quadrant suite
- Sandsoft (Sandpiper Software)
- see Semantic Technologies 2007/8/9
24Implementing semantics
- Query
- Reasoning
- Rules
- A combination?
- Use cases are the key to guide you
25Reasoners (aka Inference engines)
- Pellet
- Racer (and Racer Pro)
- SHER (IBM) http//www.alphaworks.ibm.com/tech/sher
- Medius KBS
- FACT
- fuzzyDL
- KAON2
- MSPASS
- QuOnto
- Jess (for Rules)
26Implementation Basics
- Review your documented use case with team and
experts - Go into detail of your ontology test it using
the tools you have - We will look at the use case document and examine
the actors, process flow, artifacts, etc. - You will start to develop a design and an
architecture (more on architecture and middleware
next week) - Keep in mind that it is more flexible to place
the formal semantics between/ in your interfaces,
i.e. between layers and components in your
architecture, i.e. between users and
information to mediate the exchange
27Actors
- The initial analysis will often have many human
actors - Begin to see where these can be replaced with
machine actors may require additional
semantics, i.e. knowledge encoding - If you are doing this in a team, take steps to
ensure that actors know their role and what
inputs, outputs and preconditions are expected of
them - Often, you may be able to run the use case
(really the model) before you build anything
28Process flow
- Each element in the process flow usually denotes
a distinct stage in what will need to be
implemented - Often, actors mediate the process flow
- Consider the activity diagram (and often a state
diagram) as a means to turn the written process
flow into a visual one that your experts can
review - Make sure the artifacts and services have an
entry in the resources section - Often the time you may do some searching
29Preconditions
- Often the preconditions are very syntactic and
may not be ready to fit with your
semantically-rich implementation - Some level of modeling of these preconditions may
be required (often this will not be in your first
pass knowledge encoding which focuses on the main
process flow, goal, description, etc.) - Beware of using other entities data and services
policies, access rights, registration, and cost
30Artifacts
- Add artifacts that the use case generates to the
resources list in the table - It is often useful to record which artifacts are
critical and which are of secondary importance - Be thinking of provenance and the way these were
produced, i.e. what semantics went into them and
produce suitable metadata or annotations - Engage the actors to determine the names of these
artifacts and who should have responsibility for
them (usually you want the actors to have
responsibility for evolution)
31Reviewing the resources
- Apart from the artifacts and actor resources, you
may find gaps - Your knowledge encoding is also a resource, make
it a first class citizen, i.e. give it a
namespace and a URI - Sometimes, a test-bed with local data is very
useful as you start the implementation process,
i.e. pull the data, maybe even implement their
service (database, etc.)
32Back to the knowledge encoding
- Declarative in CL, OWL (probably OWL-DL), RDF,
SKOS? - Need rules?
- Need query?
- Science expert review and iteration
- Means you need something that they can review,
with precise names, properties, relations, etc. - The knowledge engineering stage is much like a
software engineering process
33Knowledge engineering
- Mostly choose OWL-DL (and OWL 2)
- We may need to go to OWL 2 for numerical
comparisons and if so, separate your OWL 1 from
OWL 2 representations - The interplay between tools like Protégé and CMAP
maybe very important in implementing a knowledge
base that has just enough
34Implementation Basics
- Review documented use case now
- Go into detail of the ontology
- Now we will look at the use case document and
examine the actors, process flow, artifacts, etc. - Start thinking of a design and an architecture
- Semantics between/ in your interfaces
35Roles and skill-sets
- Facilitator changes slightly for implementation
- sometime the facilitator becomes chief
architect, sometimes steps back - Domain experts are needed for expert review
(domain literate, know resources data,
applications, tools, etc) - You are the modeler (to extract objects, triples)
- You are likely to play the role of a software
engineer (architecture, technology) but you can
also ask someone for help with this - Document, document, document
- It is social a team effort
36Summary
- By now, the reality of going into complete detail
for the knowledge representation should be
apparent - Keeping it simple is also very important as you
begin to implement - Being prepared to iterate is really essential
- Now is the time to validate your ontology with
domain experts and your team, use the tools - The next stage is to choose your technology
components and build and test
37E.g. use cases and implementation
- Apple orchard sensor network
- Semantic mediawiki
- Stargazer
- OWL-DL, Jena, ELMO, Pellet
- Diet exchange portal
- RDF, Perl, SPARLQL, re-use
- BCO-DMO faceted search
38Inventory
- Refer to the Resources
- Files
- Databases
- Catalogs
- Existing UI
- Services
- User database/ security
- Logging
- Backup/ archive
39Limited interoperability
- WSCommon
- Web Coverage Service
- Web Feature Service
- Web Mapping Service
Geo App2
App3
Geo App1
DBn
DB2
DB3
DB1
40The Astronomy approach data-types as a service
Limited interoperability
- VOTable
- Simple Image Access Protocol
- Simple Spectrum Access Protocol
- Simple Time Access Protocol
VO App2
VO App3
VO App1
VO layer
DBn
DB2
DB3
DB1
41Web Serv.
API
Web Portal
Query, access and use of data
Semantic mediation layer Ontology - capturing
concepts of Parameters, Instruments, Date/Time,
Space, Event, Feature, Data Product (and
associated classes, properties) and Service
Classes. Maps queries to underlying data.
Generates access requests for metadata, data.
Allows queries, reasoning, analysis, new
hypothesis generation, testing, explanation, etc.
Data as Service
Metadata, schema, data
DB
DB2
DB3
DB1
42Implementing
- Lets take an example
- VSTO
- Representative but does not exercise all semantic
web capabilities
43Web Service
44(No Transcript)
45(No Transcript)
46(No Transcript)
47(No Transcript)
48(No Transcript)
492
50Additional middleware
- Web server, Tomcat are essential (Axis)
- MySQL (or similar) is very handy to have
- OPeNDAP for data access and transport
51Web Service
52Infrastructure
- Protégé-OWL-API
- http//protege.stanford.edu/plugins/owl/api/index.
html - http//protege.stanford.edu/plugins/owl/api/guide.
html - Jena (Java API for RDF and OWL)
- http//protege.stanford.edu/plugins/owl/jena-integ
ration.html - http//jena.sourceforge.net/
- Migrate to other triple stores when needed
53Using Protégé
- Load VSTO into Protégé 3.4beta
- Generate Java-OWL classes from Tool menu
- Review other tools for generating code stubs
54Examine some of the code
- Java Factory class
- Code stubs and myclass
- VSTO code base browse it
55Jena
56Infrastructure
- Reasoner DIG/Pellet
- http//protegewiki.stanford.edu/index.php/ProtegeR
easonerAPI - SPARQL
- http//www.w3.org/2001/sw/DataAccess/tests/impleme
ntations - Spring (Application Framework - optional)
- http//www.springframework.org/
- Eclipse (IDE)
- http//www.eclipse.org/
57Software development
- Junit (generated in Eclipse)
- http//smi-protege.stanford.edu/repos/protege/owl/
trunk/junit.properties.template - Faceted browsing mspace, jspace
58Metadata
- Migrate metadata into ontologies instances,
choose how you will populate them - Manual okay to start with sufficient annotation
- Scripted preferred
- rdfs_comment essential
- Choose what you will not, cannot move
- W3 Recommendations like GRDDL are very useful
59Services
- If you are going to put up services, include an
end-point and a link to your WSDL (or SAWSDL) - At this point, developing a full services
ontology, e.g. in OWL-S may be beyond the initial
implementation
60Semantic Web Services
61Semantic Web Services
OWL document returned using VSTO ontology - can
be used both syntactically or semantically
62Result/ outcome
- Refer to the use case document
- Check the expected outcome and see if the test
(to verify outcome) is complete - Document all variations, note alternate flows
- Document in sufficient detail that someone else
could come along and re-produce your work - Include URLs for access, etc.
63Summary
- Architectural design needs to take into account
existing resources that you will leverage - Keeping it simple is also very important as you
begin to implement - Take time to learn the tools and the supporting
APIs look at existing examples and working code - Being prepared to iterate is really essential
64Tutorial Summary
- Many different options for ontology querying -
none are standard - RDF query is most advanced
- Inference needs and choice will depend on
descriptive requirements (e.g. DL, Full, RDF,
etc.)
65Reference material
66Terminology
- Ontology (n.d.). The Free On-line Dictionary of
Computing. http//dictionary.reference.com/browse/
ontology - An explicit formal specification of how to
represent the objects, concepts and other
entities that are assumed to exist in some area
of interest and the relationships that hold among
them. - Semantic Web
- An extension of the current web in which
information is given well-defined meaning, better
enabling computers and people to work in
cooperation, www.semanticweb.org - Primer http//www.ics.forth.gr/isl/swprimer/
67 Ontology Spectrum
Thesauri narrower term relation
Selected Logical Constraints (disjointness,
inverse, )
Frames (properties)
Formal is-a
Catalog/ ID
Informal is-a
Formal instance
General Logical constraints
Terms/ glossary
Value Restrs.
Originally from AAAI 1999- Ontologies Panel by
Gruninger, Lehmann, McGuinness, Uschold, Welty
updated by McGuinness. Description in
www.ksl.stanford.edu/people/dlm/papers/ontologies-
come-of-age-abstract.html
68Ontology - declarative knowledge
- The triple subject-object-predicate
- interferometer is-a optical instrument
- Fabry-Perot is-a interferometer
- Optical instrument has focal length
- Optical instrument is-a instrument
- Instrument has instrument operating mode
- Data archive has measured parameter
- SO2 concentration is-a concentration
- Concentration is-a parameter
- A query select all optical instruments which
have operating mode vertical - An inference infer operating modes for a
Fabry-Perot Interferometer which measures neutral
temperature