Before building any application: How do I know my OWL ontology is correct?
Validation, parsing, and reasoning APIs are part of your Semantic Web development environment - tools you use so you don't have to reinvent the wheel.
This chapter focuses on validation and understanding of ontology documents. We'll cover reasoning and inferencing in later chapters.
At the time of writing, there's already an impressive collection of tools available for Semantic Web development. The ecosystem continues to grow!
Similar to IDEs like Visual Studio, ontology editors offer:
http://protege.stanford.edu/
Protégé-OWL editor: Create ontology documents in a variety of formats. One of the most popular and full-featured editors.
http://www.mindswap.org/2004/SWOOP/
Swoop ontology editor with browser-like interface and excellent visualization capabilities.
http://oiled.man.ac.uk/
Editor specifically designed for ontology documents with focus on OWL.
http://www.mindswap.org
Create RDF statements from existing ontologies, making instance creation easier.
Validators check both syntax (correct XML structure, matching tags) and semantics (proper use of properties, correct value types, valid class relationships).
http://www.w3.org/RDF/Validator/
Official RDF document validation provided by W3C. We used this in Chapter 3.
http://phoebus.cs.man.ac.uk:9999/OWL/Validator
OWL ontology validator developed by University of Manchester. Quite commonly used and comprehensive.
http://projects.semwebcentral.org/projects/vowlidator/
Another OWL validation tool with good error reporting.
Markup Tool
Creates OWL markup for HTML Web pages, helping add semantic metadata to existing content.
Inference engines not only parse documents but "understand" them - deriving new knowledge from explicit statements.
Many inference tools can also be used as parsers and for storage/query operations.
http://jena.sourceforge.net/
Developed by HP Labs. Java framework providing support for RDF, RDFS, and OWL with built-in reasoning engine. Excellent documentation!
http://www.mindswap.org/2003/pellet/
Open-source Java-based OWL DL reasoner provided by Mindswap. Fast and complete reasoning.
http://www.openrdf.org/
Provides support for RDF schema reasoning with excellent storage and query capabilities.
http://www.agfa.com/w3c/euler/
Inference engine supporting logic-based proof methods and reasoning.
http://librdf.org/
Capable of manipulating triples, URIs, and graphs. Provides rich API for application development. While inference engines can handle storage/query, Redland specializes in it.
Good validators also output the entire class and property structure based on their understanding. If correct, you should see the structure you intended!
URL: http://www.mindswap.org/2003/pellet/demo.shtml
1. Direct Input: Cut-and-paste your OWL document into the RDF window
2. URL Input: Specify a link pointing to your OWL ontology document
💡 During development, direct input is often preferred - no need to upload to web server until stable!
You'll receive a result page only when your ontology is legal. If there are errors, the validator throws exceptions for you to fix.
1. OWL Classification: "This is an OWL Full ontology"
2. Reason: Why it's classified as Full, DL, or Lite
3. Class Hierarchy: Complete structure showing inheritance
4. Property Summary: All defined properties with domains/ranges
URL: http://phoebus.cs.man.ac.uk:9999/OWL/Validator
Shows complete structure including all classes and properties defined in your ontology. Helps confirm the ontology expresses what you intended.
The detailed output lets you verify every aspect of your ontology - from property characteristics to class restrictions to disjointness declarations.
Your agent may discover OWL files on the Web and needs to validate them automatically - can't wait for manual validation!
APIs allow validation, parsing, and reasoning within your application code.
Developed by HP Labs - Java framework for Semantic Web applications
Typical imports when working with Jena ontology APIs:
Must set CLASSPATH to include all Jena JAR files. Example from .cshrc file:
$JENA_DIR is your local installation directory. Replace with your actual path.
You must enumerate every JAR file you want to use - include each one individually in CLASSPATH!
How do you know your OWL document is valid?
If your document has syntax or semantic errors, Jena throws exceptions when you try to load it!
1. Try to load ontology: Use Jena APIs to read document into memory
2. Watch for exceptions: Error messages indicate problems
3. Success = Valid: If you create ontology model successfully, document is valid!
These steps aren't required for validation but satisfy curiosity and provide viewing pleasure! 😊
Jena provides comprehensive examples for all these tasks on their website. We won't repeat the code here - check their documentation!
After Jena reads your ontology, it converts to long form - expanding all namespace prefixes to full URIs.
Jena can output all classes defined in your ontology - including equivalent classes from other ontologies:
Having all these outputs from Jena APIs, we can be assured that our Camera ontology is valid and correctly structured.
Jena has much more power than just validating OWL documents! We'll explore its reasoning and query capabilities in later chapters.
1. Create: Build ontology using editor (Protégé, Swoop)
2. Validate: Use web validator during development
3. Integrate: Use APIs (Jena) for programmatic validation in applications
4. Reason: Apply inference engines to derive new knowledge (covered in later chapters)
Now that we know our ontologies are valid, we can move forward with: