Difference between a base URI and default namespace?

446 views
Skip to first unread message

Murray, William R

unread,
May 29, 2008, 8:44:13 PM5/29/08
to TopBraid Composer Users
Hi,

Would someone be so kind as to explain the difference between the base
URI of an ontology and its default namespace? I had been thinking of
these as the same, only to find out they are not.

Thanks,
Bill

Irene Polikoff

unread,
May 29, 2008, 9:30:00 PM5/29/08
to TopBraid Composer Users
Bill,

We encourage participants to limit their questions to those related
directly to TopBraid Suite rather than general questions about
standards or ontology modeling. One reason is that our development
team monitors the site for product questions and problems on the daily
basis and we do not want to have them wade through many unrelated
posts.

URI of the ontology is the unique identifier of the ontology itself.
Default namespace is the default URI prefix for the resources defined
in the ontology. It is possible to create a new resource using
abbreviated name instead of the URI. For example, just Person as
opposed to www.somedomain.com/mynamespace#Person. When abbreviation is
used in declaring resources, it is assumed that we want to use the
default namespace. If a default namespace of the ontology is
www.somedomain.com/mynamespace than Person will resolve to
www.somedomain.com/mynamespace#Person.

Similarly, in SPARQL query, if you use :Person and the default
namespace of the ontology you are running query on is www.somedomain.com/mynamespace,
it will resolve to www.somedomain.com/mynamespace#Person. When working
with modular interconnected ontologies, using the default namespaces
presents a variety of problems.

A better practice is to use qnames which include the prefix of the
namespaces e.g., mynamespace:Person.

For additional information, please take a look at this post
http://composing-the-semantic-web.blogspot.com/2007/05/default-namespaces-considered-harmful.html

Regards,

Irene

On May 29, 8:44 pm, "Murray, William R" <william.r.mur...@boeing.com>
wrote:

Murray, William R

unread,
May 29, 2008, 10:51:35 PM5/29/08
to TopBraid Composer Users
Hi, Irene,

Actually, Holger suggested I ask the question here. It came up in
relation to a problem with
Allegro Graph serializing its ontologies and not (at this time)
writing out a base URI that the
user could specify. Sounds like they will patch it, however. At
present I have to manually
edit the base URI that Allegro Graph writes out before reading the OWL
file it writes out
into TBC.

Although I understand that URIs can be abbreviated using default
namespaces, my question
is whether a default namespace is one and the same as a base URI? I
thought they were but
Holger said they were not and suggested that I post the question here
so I am assuming there
is some subtle but interesting difference in which I might be
enlightened :)

Thanks,
Bill

On May 29, 6:30 pm, Irene Polikoff <ir...@topquadrant.com> wrote:
> Bill,
>
> We encourage participants to limit their questions to those related
> directly to TopBraid Suite rather than general questions about
> standards or ontology modeling. One reason is that our development
> team monitors the site for product questions and problems on the daily
> basis and we do not want to have them wade through many unrelated
> posts.
>
> URI of the ontology is the unique identifier of the ontology itself.
> Default namespace is the default URI prefix for the resources defined
> in the ontology. It is possible to create a new resource using
> abbreviated name instead of the URI. For example, just Person as
> opposed towww.somedomain.com/mynamespace#Person. When abbreviation is
> used in declaring resources, it is assumed that we want to use the
> default namespace. If a default namespace of the ontology iswww.somedomain.com/mynamespacethan Person will resolve towww.somedomain.com/mynamespace#Person.
>
> Similarly, in SPARQL query, if you use :Person and the default
> namespace of the ontology you are running query on iswww.somedomain.com/mynamespace,
> it will resolve towww.somedomain.com/mynamespace#Person. When working
> with modular interconnected ontologies, using the default namespaces
> presents a variety of problems.
>
> A better practice is to use qnames which include the prefix of the
> namespaces e.g., mynamespace:Person.
>
> For additional information, please take a look at this posthttp://composing-the-semantic-web.blogspot.com/2007/05/default-namesp...

Irene Polikoff

unread,
May 30, 2008, 7:23:11 PM5/30/08
to TopBraid Composer Users
Hi Bill,

As I described above, base namespace and default namespace serve a
different purpose. One is identifier of the ontology and another one
as a default prefix for resources declared in the ontology when no
prefix is specified.

The same URI can be used for both (this is often done) or two
different URIs can be used.

Base URI is necessary as ontology needs identifier. Default namespace
is not necessary as namespaces to be used could (and should) be
declared by using named prefixes.

There is no RDF vocabulary for specifying the namespaces and their
prefixes. It all comes from XML. So, I am not sure how AllegroGraph
stores this information internally.

In TopBraid Composer the base namespace is used in a standard way as
an identifier for ontology. For example, when you specify an import
statement what you are specifying is an ID of an ontology to import -
its URI or base namespace. Triple stores typically don't do much with
import statements. A user loads various triples in to the database.
These could come from different ontologies and be loaded into a single
database. If they are loaded, they are all there in the database even
if the individual models did not import each other. If there is an
import statement, but the imported model is not loaded, then triple
store does not do anything to resolve this.

Composer, on the other hand, processes import statements when one
opens the model, the imports will be loaded as well. And only imported
models are loaded.

Since the database does not do anything about imports, one may wonder
why would the notion of ontology URI be important to it.

Well, one answer is that if the ontology is loaded from someplace else
and it is maintained separately someplace else, you may want to be
able to reload it later on if it changes. This means you need to
identify it and all the triples that belong to it. This may be solved
through using named graphs in the database and having the base URIs
associated with some named graphs as appropriate. Another situation
(the one you are running in to) is the need to export some or all the
contents of the database for use elsewhere. The exported file needs to
have a base URI.

Hopefully, this answers some of your questions.

Regards,

Irene

On May 29, 10:51 pm, "Murray, William R" <william.r.mur...@boeing.com>
wrote:
> > default namespace. If a default namespace of the ontology iswww.somedomain.com/mynamespacethanPerson will resolve towww.somedomain.com/mynamespace#Person.
>
> > Similarly, in SPARQL query, if you use :Person and the default
> > namespace of the ontology you are running query on iswww.somedomain.com/mynamespace,
> > it will resolve towww.somedomain.com/mynamespace#Person. When working
> > with modular interconnected ontologies, using the default namespaces
> > presents a variety of problems.
>
> > A better practice is to use qnames which include the prefix of the
> > namespaces e.g., mynamespace:Person.
>
> > For additional information, please take a look at this posthttp://composing-the-semantic-web.blogspot.com/2007/05/default-namesp...
>
> > Regards,
>
> > Irene
>
> > On May 29, 8:44 pm, "Murray, William R" <william.r.mur...@boeing.com>
> > wrote:
>
> > > Hi,
>
> > > Would someone be so kind as to explain the difference between the base
> > > URI of an ontology and its default namespace? I had been thinking of
> > > these as the same, only to find out they are not.
>
> > > Thanks,
> > >           Bill- Hide quoted text -
>
> - Show quoted text -

Li, Naicong

unread,
May 30, 2008, 7:52:19 PM5/30/08
to topbraid-co...@googlegroups.com
Hi,

Is there a way to automatically timestamp the resources in an ontology? E.g. have a property with range xsd:date for all the classes, instances and properties, and have the value of that property automatically updated to today's date for those newly created or updated resources when you do a Save? (We don't need to get down to time, just date.)

Naicong

Holger Knublauch

unread,
May 30, 2008, 8:15:28 PM5/30/08
to topbraid-co...@googlegroups.com
I don't think there is a simple solution to that right now. I have a
mechanism in progress that will run some SPARQLMotion scripts whenever a
change has been committed, and that would allow you to do such things,
but I have no release date for this yet.

If you really need that functionality soon then, doing a TopBraid
plug-in in Java would be necessary.

Holger

Li, Naicong

unread,
May 30, 2008, 8:45:55 PM5/30/08
to topbraid-co...@googlegroups.com
Thanks Holger. We will wait for the release date. In the mean time we will do something simple (partly manual) to handle this.
Naicong

Murray, William R

unread,
Jun 2, 2008, 2:29:38 PM6/2/08
to TopBraid Composer Users
Irene,

I think I get the distinction now. The base URI is required, part of
the ontology. The default namespace is a convenience, but as in the
blog note, not recommended for the reasons noted. The default
namespace can be used to abbreviate the base URI (or another), but
again, this is not recommended. Because I has always used the default
namespace to abbreviate the base URI I hadn't seen the difference
before, conflating the two concepts.

Thanks for your patient explanations!

Bill
> > > default namespace. If a default namespace of the ontology iswww.somedomain.com/mynamespacethanPersonwill resolve towww.somedomain.com/mynamespace#Person.

Rinke Hoekstra

unread,
Jun 2, 2008, 2:55:20 PM6/2/08
to topbraid-co...@googlegroups.com
Hi Bill,

Please be aware that the required presence of a base URI is TopBraid
specific and not part of the OWL/RDF specification. In this case
TopBraid just enforces a good practice, namely that the base URI and
ontology URI of an ontology should be the same.

-Rinke

Li, Naicong

unread,
Jun 2, 2008, 9:23:10 PM6/2/08
to topbraid-co...@googlegroups.com

Hi,

 

I have a small test ontology containing 3 classes:

 

Person, with instances Person_1, Person_2

Role, with subclasses Role_1, Role_2

Workflow, with instances Workflow_1, Workflow_2

 

Also 2 properties:

 

hasRole, domain = Person, range = Role

hasParticipant, domain = Workflow, range = Person

 

I want to say something like this:

 

Workflow1 has participant Person_1, who plays the role Role_1

 

Note that I don’t want to define the roles on Person_1, because Person_1 may play different roles in different Workflows.

 

I don't see a way of entering what I wanted inside the Composer, so I edited the source code outside of the Composer for Workflow_1:

 

  <Workflow rdf:ID="Workflow_1">

    <hasParticipant>

      <Person_1>

        <hasRole rdf:resource="#Role_1"/>

      </Person_1>

    </hasParticipant>

  </Workflow>

 

When I come back in the composer, I see this for Workflow_1:

 

 

And when I expand the (internally generated) instance ID for hasParticipant I see this:

 

 

It is as if the Composer created an instance of the instance Person_1, and associated Role_1 with it.  I suppose this is a way of recording a pair consisting a participant and a role (which is what I wanted)?  Is this how the Composer expected to behave?  If not, how should I do what I need to do in the Composer, without having to edit the source code externally?

 

Thanks in advance for your help.

Naicong

 

 

 

Irene Polikoff

unread,
Jun 2, 2008, 11:47:19 PM6/2/08
to TopBraid Composer Users
Hi Naicong,

I don't think this is about Composer but rather about RDF data model.
One can express only binary relationships in RDF. You can say "this
workflow has this person, this workflow has this role", etc. If you
would like to express n-ary relationship as in "in this workflow this
person plays this role", you need to reify. You would suggest creating
class called something like PersonRole. You would then do:

Workflow_1 personRole PersonRole_1
PersonRole_1 playedBy Person_1
PersonRole_1 role Role_1

For more information look for W3C best practices note on creating n-
ary relationships in RDF/OWL. I do not recall the URL, but you can
probably search for it.

Regards,

Irene

On Jun 2, 9:23 pm, "Li, Naicong" <naicong...@spatial.redlands.edu>
wrote:
> Hi,
>
> I have a small test ontology containing 3 classes:
>
> Person, with instances Person_1, Person_2
>
> Role, with subclasses Role_1, Role_2
>
> Workflow, with instances Workflow_1, Workflow_2
>
> Also 2 properties:
>
> hasRole, domain = Person, range = Role
>
> hasParticipant, domain = Workflow, range = Person
>
> I want to say something like this:
>
> Workflow1 has participant Person_1, who plays the role Role_1
>
> Note that I don't want to define the roles on Person_1, because Person_1 may play different roles in different Workflows.
>
> I don't see a way of entering what I wanted inside the Composer, so I edited the source code outside of the Composer for Workflow_1:
>
>   <Workflow rdf:ID="Workflow_1">
>
>     <hasParticipant>
>
>       <Person_1>
>
>         <hasRole rdf:resource="#Role_1"/>
>
>       </Person_1>
>
>     </hasParticipant>
>
>   </Workflow>
>
> When I come back in the composer, I see this for Workflow_1:
>
> [cid:image002....@01C8C4DD.B606E1E0]
>
> And when I expand the (internally generated) instance ID for hasParticipant I see this:
>
> [cid:image006....@01C8C4DD.B606E1E0]
>
> It is as if the Composer created an instance of the instance Person_1, and associated Role_1 with it.  I suppose this is a way of recording a pair consisting a participant and a role (which is what I wanted)?  Is this how the Composer expected to behave?  If not, how should I do what I need to do in the Composer, without having to edit the source code externally?
>
> Thanks in advance for your help.
>
> Naicong
>
>  image002.jpg
> 15KViewDownload
>
>  image006.jpg
> 21KViewDownload

Smith, Tim

unread,
Jun 3, 2008, 10:23:36 AM6/3/08
to topbraid-co...@googlegroups.com
All,

From time-to-time, some of the questions on this list are not TBC
specific but are more of a general OWL/RDF modeling nature. I know I've
posted several and would like to post several more :)

That said, what forums are available for modeling discussions? Most
forums that I am aware of are tool specific.

Any TBC users know of good forums to discuss modeling issues?

Thanks,

Tim

Li, Naicong

unread,
Jun 3, 2008, 11:13:52 AM6/3/08
to topbraid-co...@googlegroups.com
Thanks Irene for your suggestions.
Naicong
Reply all
Reply to author
Forward
0 new messages