2

I have used Lehigh University Benchmark (LUBM) to test my application.
What I know about LUBM is that its ontology contains 43 classes.
But when I query over the classes I got 14 classes!
Also, when I used Sesame workbench and check the "Types in Repository " section I got 14th classes which are:

AssistantProfessor 
AssociateProfessor 
Course 
Department 
Fullprofessor 
GraduateCourse 
GraduateStudent 
Lecturer 
Publication 
ResearchAssistant
ResearchGroup 
TeachingAssistant 
UndergraduateStudent 
University 

Could any one explain to me the differences between them?

Edit: Problem partially solved but now How can I retrieve RDF instances from the upper level of Ontology (e.g. Employee, book, Article, Chair, college, Director, PostDoc, JournalArticle ..etc) or let's say all 43 classes because I can just retrieve instances for the lower classes (14th classes) and the following picture for retrieving the instances from ub:Department

enter image description here

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • You should know that LUBM is a benchmark dataset for reasoning, and Sesame out of the box does not support reasoning. – Michael Mar 18 '14 at 10:07
  • Where did you get the data from? Is it possible you're using an older version of the ontology or something? A simple SPARQL query on the ontology from a known source shows the 43 expected types. – Joshua Taylor Mar 18 '14 at 13:58
  • Thanks all for comments – user3431350 Mar 19 '14 at 06:03
  • It looks like you actually want some of the test data, or the test data generator. I've updated my answer appropriately. – Joshua Taylor Mar 20 '14 at 20:22

2 Answers2

2

You didn't mention what data you're using, so we can't be sure that you're actually using the correct data, or even know what version of it you're using. The OWL ontology can be downloaded from the Lehigh University Benchmark (LUBM), where the OWL version of the ontology is univ-bench.owl.

Based on that data, you can use a query like this to find out how many OWL classes there are::

prefix owl: <http://www.w3.org/2002/07/owl#>
select (count(?class) as ?numClasses) where { ?class a owl:Class }
--------------
| numClasses |
==============
| 43         |
--------------

I'm not familiar with the Sesame workbench, so I'm not sure how it's counting types, but it's easy to see that different ways of counting types can lead to different results. For instance, if we only count the types of which there are instances, we only get six classes (and they're the OWL meta-classes, so this isn't particularly useful):

select distinct ?class where { ?x a ?class }
--------------------------
| class                  |
==========================
| owl:Class              |
| owl:TransitiveProperty |
| owl:ObjectProperty     |
| owl:Ontology           |
| owl:DatatypeProperty   |
| owl:Restriction        |
--------------------------

Now, that's what happens if you're just querying on the ontology itself. The ontology only provides the definitions of the vocabulary that you might use to describe some actual situation. But where can you get descriptions of actual (or fictitious) situations? Note that at SWAT Projects - the Lehigh University Benchmark (LUBM) there's a link below the Ontology download:

Data Generator(UBA):

This tool generates syntetic OWL or DAML+OIL data over the Univ-Bench ontology in the unit of a university. These data are repeatable and customizable, by allowing user to specify seed for random number generation, the number of universities, and the starting index of the universities. * What do the data look like?

If you follow the "what do the data look like" link, you'll get another link to an actual sample file,

That actually has some data in it. You can run a query like the following at sparql.org's query processor and get some useful results:

select ?individual ?class 
from <http://swat.cse.lehigh.edu/projects/lubm/University0_0.owl>
where {
  ?individual a ?class 
}
-------------------------------------------------------------------------------------------------------------------------------------------------------------
| individual                                                                  | class                                                                       |
=============================================================================================================================================================
| <http://www.Department0.University0.edu/AssociateProfessor9>                | <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#AssociateProfessor>   |
| <http://www.Department0.University0.edu/GraduateStudent127>                 | <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#GraduateStudent>      |
| <http://www.Department0.University0.edu/UndergraduateStudent98>             | <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#UndergraduateStudent> |
| <http://www.Department0.University0.edu/UndergraduateStudent182>            | <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#UndergraduateStudent> |
| <http://www.Department0.University0.edu/GraduateStudent1>                   | <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#TeachingAssistant>    |
| <http://www.Department0.University0.edu/AssistantProfessor4/Publication4>   | <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#Publication>          |
| <http://www.Department0.University0.edu/UndergraduateStudent271>            | <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#UndergraduateStudent> |
| <http://www.Department0.University0.edu/UndergraduateStudent499>            | <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#UndergraduateStudent> |
| <http://www.Department0.University0.edu/UndergraduateStudent502>            | <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#UndergraduateStudent> |
| <http://www.Department0.University0.edu/GraduateCourse61>                   | <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#GraduateCourse>       |
| <http://www.Department0.University0.edu/AssociateProfessor10>               | <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#AssociateProfessor>   |
| <http://www.Department0.University0.edu/UndergraduateStudent404>            | <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#UndergraduateStudent> |
…

I think that to get the kind of results you're looking for, you need to download this data, or download a version of the UBA test data generators and generate some of your own data.

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • Thanks Joshua for your feedback. You are alright, it is 43 classes and I guess the 14th classes are the lower classes (?instance a ?class), is it right? – user3431350 Mar 19 '14 at 06:04
  • Joshua, How can I generate RDF triples for the upper classes or let's say all 43 classes because I can just generate triples for the lower classes (14th classes mentioned above) – user3431350 Mar 19 '14 at 06:08
  • @user3431350 I don't know whether the 14 results you're seeing are similar to the 6 that I showed or not, because you haven't told us where your data came from, so I don't know whether we're using the same data or not. I also don't know what you mean by "generate RDF triples for the … classes"; the ontology is already serialized in RDF, so you've already _got_ a bunch of triples—what more do you want to generate? – Joshua Taylor Mar 19 '14 at 12:35
  • Thanks Joshua for your answer. I used the same ontology located at ( the Lehigh University Benchmark (LUBM)) and the owl version is univ-bench.owl. I got 43 classes as a total number of classes and to find the lower classes I used the following query (?resource a ?class) which result in 14 classes. Now I would generate RDF triples (instances of classes) for the whole 43 classes but what I can do is just generate RDF triples (instances of classes) for the 14 classes! – user3431350 Mar 20 '14 at 19:48
  • @user3431350 It's still not clear at all what you mean. The reason you only see 14 classes when you query for `?resource a ?class` is because the only triples of the form `[?resource rdf:type ?class]` in the OWL file are the declarations of the properties and OWL classes. The ontology doesn't include any instance data. It doesn't, for instance, say that any particular thing is a `Course` or `Department`; it just declares those classes. It's still not clear what triples you want to generate. Please generate a few by hand, and add them to the question, so we know what you're trying to do. – Joshua Taylor Mar 20 '14 at 19:53
  • let’s take an example of one of the 14 classes mentioned in the main post (e.g. Department) it is easy to generate its instances like this ([IMG]http://i.imgur.com/gYk3ERH.png[/IMG]), but when I want to generate instances for the upper level of ontology (e.g. Employee, book, Article, Chair, college, Director, PostDoc, JournalArticle ..etc) I can’t. So what is the reason for that? Thanks – user3431350 Mar 20 '14 at 20:07
  • @user3431350 1) You're not generating those triples, you're retrieving them. Just like Google doesn't generate web pages for me, it finds them for me. 2) Where'd that data come from? That looks like _instance_ data; i.e., a description of some actual or ficticious or university. That's not the same data as what's in the ontology. The ontology just provides the vocabulary. Where'd the data in that image come from? 3) This conversation is clarifying the question, and the information in it should be edited into the question (by you). There's an edit link just below the question. Other… – Joshua Taylor Mar 20 '14 at 20:12
  • @user3431350 …people may be able to help answer your question, but they might not see the comments on the answers to your question, so you need to add this information to the question itself. Stack Overflow is a question and answer site, not a forum. – Joshua Taylor Mar 20 '14 at 20:13
2

If you use UBA (the LUBM data generator), you get instance data, where instances are declared to be of certain types. E.g.

<http://www.Department0.University31.edu/FullProfessor4>
   rdf:type
      ub:FullProfessor

It turns out, when you run UBA, it only asserts instances into the 14 classes you mention.

The LUBM ontology actually defines 43 classes. These are classes that are available to be used in instance data sets.

In OpenRDF Sesame, when it lists "Types in Repository", it is apparently just showing those types which are actually "used" in the data. (I.e., there is at least 1 instance asserted to be of that type/class in the data.)

That is the difference between your two lists. When you look at the ontology, there are 43 classes defined (available for use), but when you look at actual instance data generated by LUBM UBA, only those 14 classes are directly used.

(NOTE: If you had a triple store with OWL reasoning turned on, the reasoner would assert the instances into more of the classes defined in the ontology.)