0

I'm trying to query dbpedia about some country, and I successfully get all it's triples, including this one for example:

"http://live.dbpedia.org/resource/Spain", 
"ns8:capital", 
"http://live.dbpedia.org/resource/Madrid"

then I want to get data about it's capital. How can I match the meaning of capital to "ns8:capital" string

I assume that this part

  xmlns:ns8="http://live.dbpedia.org/property/"

points to this one

"http://live.dbpedia.org/property/capital"

but how can I distinguish it vice versa?

Herokiller
  • 2,891
  • 5
  • 32
  • 50
  • 1
    It is not clear to me what the problem is. For one thing, what does it mean to "match the meaning of capital to 'ns8:capital' string" or to "distinguish it vice versa"? Please try and edit your question to make it clearer what you are after, exactly. – Jeen Broekstra Mar 04 '15 at 23:27
  • The prefix notation is just string concatenation. When you have `xmlns:ns8="http://live.dbpedia.org/property/"` it means that `ns8:` is an *abbreviation* for `http://live.dbpedia.org/property/`. That means that `ns8:capital` is just shorthand for `http://live.dbpedia.org/property/capital`. If you're using *RDF* processing tools, you should never really end up with the *string* `ns8:captial`, since RDF uses IRIs for properties. Things like `ns8:capital` only show up in serializations, but *RDF* APIs will always give you a way to get the actual IRI. – Joshua Taylor Mar 05 '15 at 19:41
  • @JoshuaTaylor why didn't you write that as an answer? I find many "unanswered" questions around the semantic web tag that you essentially answered in comments. – Jörn Hees May 18 '15 at 16:34
  • @JörnHees I'm not sure whether that actually answers the OP's question or not. If it's the case that OP is just looking at the printed representation of the results, when the API would provide the actual URI, then that might help, but without knowing what API OP is using, I can't provide the code that would get the URI. And OP doesn't seem to be responding to comments, so we're not getting any clarification. – Joshua Taylor May 18 '15 at 16:39
  • 1
    @JörnHees I'm generally pretty good about posting answers as answers, and posting requests for clarification and more information as comments. If there are any I've missed where OP replied and said "yes, that works"; I'll be happy to post as an answer. – Joshua Taylor May 18 '15 at 16:40
  • @JörnHees There is an exception there, though. Note that one of the close reasons is **"This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers."** If something is pretty much a typo; I usually just mention it in the comments and vote to close with that close reason. – Joshua Taylor May 18 '15 at 16:42

0 Answers0