Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6346799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:05:17+00:00 2026-05-24T21:05:17+00:00

I’m new to this entire semantics stuff, and i’ve been plunged into a project

  • 0

I’m new to this entire semantics stuff, and i’ve been plunged into a project which requires me to use the SPARQL endpoint from dbpedia to retrieve information about certain things such as a City for example. The idea is that my application collects a few of these keywords (which are predefined, such as City, Country & Region) and rely on dbpedia to get some sensible information about this.

After fiddling around with the SPARQL endpoint for some time, I came up with the following query:

PREFIX dbo: <http://dbpedia.org/ontology/> 
PREFIX prop: <http://dbpedia.org/property/>

SELECT ?city
WHERE {
?city prop:name "X"@en; 
a dbo:PopulatedPlace
}

Where X stands for the name of the city that I’m trying to get information about. When I run this query against the SPARQL endpoint, I receive a URI in a RDF structure that points to a RDF store on DBPedia (at least that’s how I interpret it, please correct me if I’m wrong)

The returned result for the City “Antwerpen” looks like this:

<rdf:RDF><rdf:Description rdf:nodeID="rset"><rdf:type rdf:resource="http://www.w3.org/2005/sparql-results#ResultSet"/><res:resultVariable>city</res:resultVariable><res:solution rdf:nodeID="r0"><res:binding rdf:nodeID="r0c0"><res:variable>city</res:variable><res:value rdf:resource="http://dbpedia.org/resource/Antwerp"/></res:binding></res:solution></rdf:Description></rdf:RDF>

I’m using Ruby on Rails with the RDF for Ruby gem to work with RDF data. But honestly, I’m clueless on how to actually work with this information. When I follow the link, I seem to be receiving an RDF store that contains all information about the city I queried.

Am I right in that I probably need to point my Code to the URI received and parse our the information I desire? Or should it be possible for example to select some information directly through the SPARQL endpoint? Like for example the description & demographic data?

I know this is a pretty vague question, but I’m trying my best to get the hang of this technology, and looking for some examples to help me better understand it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:05:17+00:00Added an answer on May 24, 2026 at 9:05 pm

    It’s probably easier to get started by getting all the info you want directly from the SPARQL endpoint. You can use a query like this:

    SELECT ?city ?property ?value
    WHERE {
        ?city prop:name "X"@en; 
              a dbo:PopulatedPlace;
              ?property ?value .
    }
    

    This will return a bunch of properties and values that describe the city in some detail and it will give you a flavour for the kind of information that you can get.

    A next step would be to query specifically for the properties you’re interested in:

    SELECT *
    WHERE {
        ?city prop:name "Galway"@en; 
              a dbo:PopulatedPlace .
        OPTIONAL { ?city dbo:populationUrban ?pop }
        OPTIONAL { ?city foaf:homepage ?homepage }
        OPTIONAL { ?city geo:lat ?lat }
        OPTIONAL { ?city geo:long ?long }
    }
    

    I’m putting each of the triple patterns into an OPTIONAL block because some cities may not have all of the information available. Without the OPTIONAL block, you’d only get a result if all the triple patterns match for the city.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.