Setting Up Namespaces

  • View
    224

  • Download
    0

Embed Size (px)

Text of Setting Up Namespaces

  • What is an Ontology?

    Catalog/ID

    GeneralLogicalconstraints

    Terms/glossary

    Thesaurinarrowertermrelation

    Formalis-a

    Frames(properties)

    Informalis-a

    Formalinstance

    Value Restrs.

    Disjointness, Inverse, part-of

  • A Few Observations about Ontologies

    Simple ontologies can be built by non-expertsVeritys Topic Editor, Collaborative Topic Builder, GFP, Chimaera, Protg, OIL-ED, etc.Ontologies can be semi-automatically generatedfrom crawls of site such as yahoo!, amazon, excite, etc.Semi-structured sites can provide starting pointsOntologies are exploding (business pull instead of technology push)most e-commerce sites are using them - MySimon, Amazon, Yahoo! Shopping, VerticalNet, etc.Controlled vocabularies (for the web) abound - SIC codes, UMLS, UN/SPSC, Open Directory (DMOZ), Rosetta Net, SUO Business interest expanding ontology directors, business ontologies are becoming more complicated (roles, value restrictions, ), VC firms interested,DTDs are making more ontology information available Markup Languages growing XML, RDF, DAML, RuleML, xxMLReal ontologies are becoming more central to applications

  • Chimaera A Ontology Environment Tool

    An interactive web-based tool aimed at supporting:Ontology analysis (correctness, completeness, style, )Merging of ontological terms from varied sourcesMaintaining ontologies over timeValidation of input Features: multiple I/O languages, loading and merging into multiple namespaces, collaborative distributed environment support, integrated browsing/editing environment, extensible diagnostic rule language Used in commercial and academic environments Available as a hosted service from www-ksl-svc.stanford.edu Information: www.ksl.stanford.edu/software/chimaera

  • Setting Up Namespaces

  • Housekeeping

    $Id: daml+oil-ex.daml,v 1.8 2001/03/27 21:24:04 horrocks Exp $ An example ontology, with data types taken from XML Schema followed by

  • Defining Classes

    Animal This class of animals is illustrative of a number of ontological idioms.

  • Defining Classes cont.1 It perfectly admissible for a class to have multiple superclasses: A Man is a Male Person ...and a Woman is a Female Person.

  • Defining Properties

  • Defining Properties cont.1 shoesize is a DatatypeProperty whose range is xsd:decimal. shoesize is also a UniqueProperty (can only have one shoesize)

  • Defining Property Restrictions

  • Defining Property Restrictions cont.1 1

  • Defining Property Restrictions cont.2 Animals have exactly two parents, ie: If x is an animal, then it has exactly 2 parents (but it is NOT the case that anything that has 2 parents is an animal). Such an assertion "

  • Defining Properties cont.1 age is a DatatypeProperty whose range is xsd:decimal. age is also a UniqueProperty (can only have one age)

  • Defining Properties cont.2rdf:about="http://www.daml.org/2001/03/daml+oil-ex.daml#Animal"

  • Defining Properties cont.3

  • Defining Properties cont.4

  • Notations for properties

  • Notations for properties cont.1If x's parent is y, then y is x's child. This is defined using the inverseOf tag. The hasAncestor and descendent properties are transitive versions of the hasParent and hasChild properties. hasAncestor

  • Notations for properties cont.2Sometimes, we like to refer to mothers using the synonym mom. The tag samePropertyAs allows us to establish this synonymy:

  • Notations for classes

    no car is a person

  • Notations for classes cont.1An even more compact idiom is to state that a whole set of classes are all pairwise disjoint. Rather than stating the individual disjointness relations, this can be stated for a set of classes in a single statement:

  • Notations for classes cont.2We can also identify a Class with the disjoint union of a set of other classes. In this case, we identify the Class Person with the disjoint union of the Classes Man and Woman. every person is a man or a woman

  • Notations for classes cont.3We have already seen that we can construct a new class by taking the complementOf another class. In the same way, we can construct classes out of the intersection of other classes:

  • Notations for classes cont.4Similarly, we can construct a class as the unionOf a set of classes:

  • Notations for classes cont.5Just as for properties, a mechanism exists for declaring synonyms for classes:

  • Using User-defined Datatypes

    Then we could reference elements of this file in DAML+OIL restrictions,

  • Defining individuals

    We can also define individual objects in a class, e.g., Adam, a person of age 13 and shoesize 9.5: Adam Adam is a person.

  • Defining individuals cont.1A Person has a property called hasHeight, which is a Height. (hasHeight is a Property, or relation; Height is a Class, or kind of thing.)

  • Defining individuals cont.2Height is a Class described by an explicitly enumerated set. We can describe this set using the oneOf element. Like disjointUnionOf, oneOf uses the RDF-extending parsetype="daml:collection".

  • Defining individuals cont.3Finally, TallThing is exactly the class of things whose hasHeight has the value tall:

  • Defining individuals cont.4 shirtsize is a DatatypeProperty whose range is clothingsize. associatedData is a DatatypeProperty without a range restriction.

  • Defining individuals cont.5 BigFoots (BigFeet?) are exactly those persons whose shosize is over12.

  • Defining individuals cont.6 Persons have at most 1 item of associatedData 1

  • Defining individuals cont.7Now we can (try to) create several individuals. 14 37 9.5 46 15

    So in this document, the rdf: prefix should be understood as referring to things drawn from the namespace called http://www.w3.org/1999/02/22-rdf-syntax-ns#. This is a conventional RDF declaration appearing verbatim at the beginning of almost every rdf document.xmlns:rdfThe second and third declarations make similar statements about the RDF Schema and XML Schema datatype namespaces. The fourth declaration says that in this document, elements prefixed with daml: should be understood as referring to things drawn from the namespace called http://www.daml.org/2001/03/daml+oil# . This again is a conventional DAML+OIL declaration. The fifth declaration says that in this document, elements prefixed with dex: should be understood as referring to things drawn from the namespace called http://www.daml.org/2001/03/daml+oil-ex#, i.e., the location of this document itself. The sixth declaration says that in this document, elements prefixed with exd: should be understood as referring to things drawn from the namespace called http://www.daml.org/2001/03/daml+oil-ex-dt#, which is a sibling document to this document itself, containing XML Schema datatype definitions used in this document. This is conventional in many DAML+OIL documents, as they will have a separate document containing XML Schema datatype definitions. The final declaration states that unprefixed elements refer to http://www.daml.org/2001/03/daml+oil-ex# , i.e., the location of this document itself.

    The first thing we do inside this RDF document is to assert that this is an ontology. This assertion is formulaic; the about attribute will typically be empty, indicating that the subject of this assertion is this document.Same-document referenceThen we give a couple of properties of this ontology for documentation purposes:Inside the Ontology element, we list any imported ontologies (using imports properties). This particular ontology depends only on the standard DAML+OIL ontology (used in the namespace definitions above).Note that this (imports) tag is an empty element; the same tag starts and ends the element, denoted by the trailing "/" just before the closing ">". Now, we begin our ontology definitions. In order to describe objects, it is useful to define some basic types. This is done by giving a name for a class, which is the subset of the universe which contains all objects of that type. If we are working in a domain of animals, we will want to define a kind of thing called animal. To do this, we use a Class tagThis asserts that there is a class known as Animal. It doesn't say anything else about animal other than specifying an identifier. It is also not (necessarily) the sole source of information about Animals; we will see below how we can add to a definition made elsewhere.However, by saying that its ID is Animal, we make it possible for others to refer to the definition of Animal we're giving here. (This is done using the uri of the containing page followed by #Animal.)These two lines introduce a label -- a brief identifier of the enclosing element, suitable for graphical representations of RDF, etc. -- and a comment -- a natural language (English, in this case) description of the element within which it is included. Neither a label nor a comment contributes to the logical interpretation of the language.DAML+OIL divides the world up into objects, which are elements of DAML classes, and datatype values, i.e., values that come from XML Schema datatypes, like the integer 4. Here we are creating an object class. Later we will see examples of datatypes. Datatype values are used to help define classes, but they are not DAML objects and cannot be included in a DAML object class. There are two types of animals, Male and Female.The subClassOf element asserts that its subject -- Male -