more on prefixes

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

more on prefixes

Alexander Nakhimovsky
I would like to use Protege to create a simple Turtle file that does
the following:

  declare two prefixes, dc: for Dublin Core Elements and foaf: for
friend of a friend
  create a class, eduOrganization that is a subclass of foaf:Organization
  create an object property, startTime, to indicate when an
eduOrganization was founded
  specify that its domain is dc:Date

After a long time trying I still don't know how to create such a file
in Protege. In particular, when one declares a prefix in RC1, the
program doesn't notice this: if you try to save, there's nothing to
save; if you Save As... the namespace declaration is not saved.

Does this all mean that in order to use an ontology one has to import
it in its entirety?

--
Alexander Nakhimovsky, Computer Science Department
Colgate University Hamilton NY 13346
   http://cs.colgate.edu/~sasha
Director, Linguistics Program
   http://www.colgate.edu/linguistics
Director, Project Afghanistan
   http://www.colgate.edu/projectafghanistan
t. +1 315 228 7586 f. +1 315 228 7009
_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
Reply | Threaded
Open this post in threaded view
|

Re: more on prefixes

Thomas Russ

On May 11, 2011, at 10:52 AM, Alexander Nakhimovsky wrote:

> I would like to use Protege to create a simple Turtle file that does
> the following:
>
>  declare two prefixes, dc: for Dublin Core Elements and foaf: for
> friend of a friend
>  create a class, eduOrganization that is a subclass of  
> foaf:Organization
>  create an object property, startTime, to indicate when an
> eduOrganization was founded
>  specify that its domain is dc:Date
>
> After a long time trying I still don't know how to create such a file
> in Protege. In particular, when one declares a prefix in RC1, the
> program doesn't notice this: if you try to save, there's nothing to
> save; if you Save As... the namespace declaration is not saved.
>
> Does this all mean that in order to use an ontology one has to import
> it in its entirety?

Well, the problem that you get if you don't import the ontology is  
that any information about the meaning of the names in that ontology  
is not available.  The name is just a name.

So, for example, if you want to create a subclass of  
foaf:Organization, but haven't imported the foaf ontology, then there  
is no definition of foaf:Organization as an owl:Class.  Now, in this  
case, an OWL system could infer that foaf:Organization must be an  
owl:Class based on context, but that information isn't explicit  
anywhere.  And there wouldn't be any inferences available about, say,  
the superclasses of foaf:Organization.

Similarly for dc:Date.  There is no information about what the meaning  
of that term is without importing the ontology.

So, you really do generally need to import an ontology -- or at least  
a extract of an ontology -- in order to use the terms and have their  
meanings present.
_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
Reply | Threaded
Open this post in threaded view
|

Re: more on prefixes

Timothy Redmond
In reply to this post by Alexander Nakhimovsky
On 05/11/2011 10:52 AM, Alexander Nakhimovsky wrote:
I would like to use Protege to create a simple Turtle file that does
the following:

  declare two prefixes, dc: for Dublin Core Elements and foaf: for
friend of a friend

This is easily done in the Ontology Prefixes view.  The new prefixes can be added by clicking the icon with the two circles and the + sign in the Ontology Prefixes view (see attachment).  If you don't see this view in the Active Ontology tab then you can add it with Window->Ontology Views->Ontology Prefixes.

  create a class, eduOrganization that is a subclass of foaf:Organization

Though it is not necessary, the best way to do this is to import the foaf ontology.  Otherwise you will have to declare the foaf:Organization class yourself.

  create an object property, startTime, to indicate when an
eduOrganization was founded
  specify that its domain is dc:Date

You can do this though as far as I can tell dublin core doesn't have a dc:Date class.  But you can declare your own and then use it.  It is a bit awkward to create a class with a full uri and this is something that I need to fix very soon.  I created a date class and then refactored the uri. 


After a long time trying I still don't know how to create such a file
in Protege. In particular, when one declares a prefix in RC1, the
program doesn't notice this: if you try to save, there's nothing to
save; if you Save As... the namespace declaration is not saved.

When I set the prefix and saved the file the prefixes were saved.  You can see them in the turtle file:

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .


Does this all mean that in order to use an ontology one has to import
it in its entirety?

Not necessarily though it is generally recommended.  You can use the names from an ontology without importing them.  This just requires that you declare the entity that you need and replicate any facts about the entity that are needed in your ontology. 

The foaf import looks good so I imported it.   Unfortunately the dublin core rdf file is unfriendly to OWL.  There is one version of an OWL aware version here:

http://protege.stanford.edu/plugins/owl/dc/protege-dc.owl

This is not definitive though - some of this could be done in different ways.

The attached turtle file was made in Protege 4.1 rc2.

-Timothy



_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03

OntologyPrefixesView.png (49K) Download Attachment
EduOrganization.png (81K) Download Attachment
Turtle.owl (1K) Download Attachment