0

Given a random set of DBpedia resources (objects), I'd like to get all their types, e.g. resources they are related to with ANY KIND of type-relationship. Therefore, I want to identify that kind of property, i.e., all kinds of type-properties. I've found these so far:

- http://dbpedia.org/ontology/type
- dbpedia-owl:wikiPageRedirects*/dbpedia-owl:type //in case of a redirect
- http://dbpedia.org/property/wordnet_type
- http://dbpedia.org/property/type
- http://www.w3.org/1999/02/22-rdf-syntax-ns#type

How can I find all the cases I have to cover? (All type-properties, all redirect possibilities...?) Is there some structure behind this, and where would I start looking?

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
SuperUser01
  • 199
  • 1
  • 13
  • What counts as a "type-relationship" is subjective and context-dependent. You might consider dcterms:subject, as it relates DBpedia resources to DBpedia/Wikipedia categories (distinct from DBpedia ontology classes). That's a categorization, but I don't know if you'd call it a type or not. Unless you have some specific criteria for what would be a "type-property" that's implementable in code, this is going to be primarily opinion based. – Joshua Taylor May 26 '14 at 21:28
  • As an example of an opinion, I wouldn't count `dbpedia-owl:wikiPageRedirects*/dbpedia-owl:type` because the point of `dbpedia-owl:wikiPageRedirects` is to point you to something *different*; it's not the same thing. If it were the same thing, you'd have `owl:sameAs`. – Joshua Taylor May 26 '14 at 21:29
  • Any more input on this? I notice that one possible thing you might use is that all of these properties contain the string "type" in their URI (in fact, they all *end* with it). You could look for those properties, I suppose. – Joshua Taylor May 27 '14 at 20:13
  • @Joshua http://dbpedia.org/resource/Cupertino is being redirected, so I feel that if there are two "Cupertino things" that are different, the first doesn't exist. (As it is being redirected...) – SuperUser01 Jun 01 '14 at 14:45
  • @Others: Thanks, I wasn't aware that the "class of type-properties" is a subjective one. I will have to think of subjective criteria to define this class, as Joshua pointed out. – SuperUser01 Jun 01 '14 at 14:46
  • There *are* some more objective criteria that you could make. E.g., you could ask for anything that's a subproperty of rdf:type, though I don't know whether much is declared that way or not. Still, you'd have to define exactly what objective criteria you want; it won't be universal. – Joshua Taylor Jun 01 '14 at 16:59

1 Answers1

0

So how do I find all the cases I have to cover? (All type-properties, all redirect possibilities...?) Is there some structure behind this / where would I start looking?

Unless you have some criteria for defining what is and what isn't a type property, then you're not really going to have much luck in this. If you just wanted, e.g., all the properties that end with type, then you could use a query like:

select distinct ?p where {
  [] ?p []
  filter strends(str(?p), "type") 
}

but that won't actually get you everything in the case of DBpedia, probably because it hits some internal time limit. However, for some given resources, you can provide the value of the subject that you care about, and get the results just for the given resources. E.g,.

select distinct ?p where {
  dbpedia:Mount_Monadnock ?p []
  filter strends(str(?p), "type") 
}
limit 100

SPARQL results

p
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://dbpedia.org/ontology/type
http://dbpedia.org/property/type
http://dbpedia.org/property/wordnet_type

Of course, you probably want the values, too:

select distinct ?p ?type where {
  dbpedia:Mount_Monadnock ?p ?type
  filter strends(str(?p), "type") 
}

SPARQL results

What you've said in:

- http://dbpedia.org/ontology/type
- dbpedia-owl:wikiPageRedirects*/dbpedia-owl:type //in case of a redirect

is actually a bit misleading. dbpedia-owl:type is the property http://dbpedia.org/ontology/type, it's just written using the dbpedia-owl: prefix. If you're concerned about redirects, you'd be concerned about redirects for all the resources and their properties, not just dbpedia-owl:type. That is, you'd use a query like

select distinct ?p ?type where {
  dbpedia:Mount_Monadnock dbpedia-owl:wikiPageRedirects* ?actualThing .
  ?actualThing ?p ?type .
  filter strends(str(?p), "type") 
}
Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • Thanks for the extensive explanation. As stated above, I was in the belief there was a more objective definiton of type properties. Nonetheless, I find your answer very helpful. – SuperUser01 Jun 01 '14 at 14:52