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 6589195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:08:31+00:00 2026-05-25T17:08:31+00:00

I am writing a python script to extract Entity names from a collection of

  • 0

I am writing a python script to extract “Entity names” from a collection of thousands of news articles from a few countries and languages.

I would like to make use of the amazing DBPedia structured knwoledge, say for example to look up the names of “artists in egypt” and names of “companies in Canada”.

(If these information was in SQL form, I would have had no problem.)

I would prefer to download the DBPedia content and use it offline. any ideas of what is needed to do so and how to query it locally from python ?

  • 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-25T17:08:32+00:00Added an answer on May 25, 2026 at 5:08 pm

    DBpedia content is in RDF format. The dumps can be download from here

    Dbpedia is a large dataset in RDF, for handling that amount of data you need to use Triple Store technology. For Dbpedia you will need one of native triple stores, I recommend you to use either Virtuoso or 4store. I personally prefer 4store.

    Once you have your triple store set up with Dbpedia in it. You can use SPARQL to query the Dbpedia RDF triples. There are Python libraries that can help you with that. 4store and Virtuoso can give you results back in JSON so you can easily get by without any libraries.

    Some simple urllib script like …

    def query(q,epr,f='application/json'):
        try:
            params = {'query': q}
            params = urllib.urlencode(params)
            opener = urllib2.build_opener(urllib2.HTTPHandler)
            request = urllib2.Request(epr+'?'+params)
            request.add_header('Accept', f)
            request.get_method = lambda: 'GET'
            url = opener.open(request)
            return url.read()
        except Exception, e:
            traceback.print_exc(file=sys.stdout)
            raise e 
    

    can help you out to run SPARQL … for instance

    >>> q1 = """
    ... select ?birthPlace where {
    ... <http://dbpedia.org/resource/Claude_Monet> <http://dbpedia.org/property/birthPlace> ?birthPlace .
    ...  }"""
    >>> print query(q1,"http://dbpedia.org/sparql")
    
    { "head": { "link": [], "vars": ["birthPlace"] },
      "results": { "distinct": false, "ordered": true, "bindings": [
        { "birthPlace": { "type": "literal", "xml:lang": "en", "value": "Paris, France" }} ] } }
    >>> 
    

    I hope this gives you an idea of how to start.

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

Sidebar

Related Questions

I'm writing a python script to extract data out of our 2GB Apache access
I amm writing a little python script that will grab information from VMs of
I am writing a python script to combine about 20+ RSS feeds. I would
I'm writing a Python script to process emails returned from Procmail . As suggested
I'm writing a python script that uses subprocess.Popen to execute two programs (from compiled
I'm writing a python script to replace strings from a each text file in
I was writing a simple python script to read from and reconstruct data from
I'm writing a set of tool in python to extract data from some xml
I am writing a python script that parses a 3D model file from one
I'm writing a python script which I would like to be able to both

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.