html5-img
1 / 16

Namespaces

Namespaces. … and ontologies. Namespaces. The goal is to ensure that domains with similar characteristics use a shared vocabulary as much as possible XML supports and explicit notion of a namespace Namespaces can be scoped using XML element nesting. Example from Bernstein et al book.

honora
Download Presentation

Namespaces

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Namespaces … and ontologies

  2. Namespaces • The goal is to ensure that domains with similar characteristics use a shared vocabulary as much as possible • XML supports and explicit notion of a namespace • Namespaces can be scoped using XML element nesting

  3. Example from Bernstein et al book

  4. Kinds of namespaces • Namespaces for XML technology itself, including XML and XML Schema • targetNamespace: for the domain-specific tags that appear in your XML code

  5. Dealing with ambiguity • We can use a prefix to specify the namespace we are referring to

  6. How namespaces are specified • A list of terms and definitions • A list of elements and attributes in an XML language • Such as the XSLT namespace • A hierarchical set of terms • Such as the Dublin Core

  7. Example: the XSLT namespace

  8. Example: Dublin Core

  9. Programmers use namespaces • Before writing code for a new application, programmers often define a new namespace or augment one. • An example: C++ namespace: classes, objects, functions • Without: • With:

  10. Example: Biomodels • BioModels Database is a free and open-source database for storing, exchanging and retrieving published quantitative models of biological interest. • Example: • hasPart • The biological entity represented by the model element includes the subject of the referenced resource (biological entity B), either physically or logically. This relation might be used to link a complex to the description of its components. • hasProperty • The subject of the referenced resource (biological entity B) is a property of the biological entity represented by the model element. This relation might be used when a biological entity exhibits a certain enzymatic activity or exerts a specific function. • hasTaxon • The biological entity represented by the model element is taxonomically restricted, where the restriction is the subject of the referenced resource (biological entity B). This relation may be used to ascribe a species restriction to a biochemical reaction. • hasVersion • The subject of the referenced resource (biological entity B) is a version or an instance of the biological entity represented by the model element. This relation may be used to represent an isoform of modified form of a biological entity.

  11. Ontologies: namespaces and assertions • Generally specified as triples • RDF is often used to specify triples; it has an XML syntax • OWL is a popular syntax for specifying triples

  12. Inferences: chaining assertions • Birds have feathers & • doves are birds • -> doves have feathers

  13. Popular tool for specifying and editing ongologies: Protoge • http://protege.stanford.edu/ • Example of the Classes/Hierarchy tab:

  14. SPARQL: a language for chaining assertions • Based on RFD • RFD example: <rdf:RDF xmls:rdf=”http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmls:zx=http://www.someurl.org/zx/> <rdf:Description rdf:about=”http://www.awebsite.org/index.html”> <zx:topic>funstuff</zx:topic> </rdf:Description> </rdf:RDF>

  15. Example of RDF • It uses a set of standardized RDF-specific tags, and the second line of code tells us where these tags come from: the w3.org site, which contains a vast store of information about advanced web technology. In other words, we can go to w3.org to find the precise definition of RDF specific tags. • RDF is engineered to also use other sets of tags, in particular, domain-specific tags. In this example, these tags come from a (non-existing) url called someurl.org. The tags themselves are prefaced with “zx:” in the rest of the code, so we know which tags are native RDF and which come from a domain-specific set of tags (called a namespace). • The xml “element” called Description is an RDF-specific tag that tells us we are giving the description of some resource on the Web, namely one at a (non-existing) website called awebsite.org. • The whole piece of code is one triple: It says that the topic of the resource at www.awebsite.org/index.html is funstuff. Here it is as a triple, with all the xml syntax and the namespace information removed: www.awebsite.org/index.html <topic> funstuff

  16. SPARQL (almost) • prefix website1: <http://awebsite.org/ > • SELECT ?x • WHERE • { website1:was-created-by ?x } • This code will find the creators of http://awebsite.org. You could imagine that there are actually many thousands of these triples, and that they tell us who built a large number of different websites. Now, we see the power of this query. It will search through all of these triples and find the two of interest to us, and then pluck off the names of the creators. • In fact, these triples could be distributed all around the Web, and we could imagine a search engine taking this query and running it everywhere on the Web where was-created-by triples are stored, and then having it bring back all the creators of awebsite, even if there are a hundred developers, and even if these names are spread around the Internet.

More Related