3 Mayıs 2013 Cuma

dbpedia vs freebase

For my thesis project, i need a programmatically easy-to-use, powerful dictionary.. Therefore, i made (collected actually) a list of items that compares Freebase (http://www.freebase.com/) and Dbpedia (http://dbpedia.org/About).

  • Dbpedia in general is more accurate as it directly rips off stuff from Wikipedia.  Freebase has a longer tail, since it collects info not just from Wikipedia, but also various other data sources.
  • Both extract structured data from Wikipedia and make it available as RDF.
    • Different schemas, identifiers, goals 
      • Dbpedia -> stores its data as RDF tuples
      • Freebase -> n-tuples
      • Dbpedia -> data is automatically generated from Wikipedia several times a year
      • Freebase -> data is automatically imported into Freebase after two weeks
      • Dbpedia -> query via a SPARQL endpoint
      • Freebase -> query via an MQL (Metaweb Query Language) API 
    • Differences in
      • Range of data sources
        • Dbpedia -> focuses on just Wikipedia data
        • Freebase -> import data from a wide variety of sources
      • Ability to edit content
        • Dbpedia -> requires that you edit Wikipedia for the change to appear in Dbpedia
        • Freebase -> user-editable, contributions can be made via a public interface
      • Structure of organizations
        • Dbpedia -> funded by various organizations
        • Freebase -> funded by Google
Through the common link of Wikipedia, it is possible to link some Freebase topics to Dbpedia resources.
(in Freebase RDF output OWL:SameAs points to Dbpedia) Example: http://dbpedia.org/page/Tetris

Freebase -> open, Creative Commons licenced, graph database

An entity is a single person, place or thing. Freebase connects entities together as a graph. 

Freebase API:
  • a collection of HTTP API's providing read & write access to data stored in Freebase.
  • different API's support different use cases.
  • SEARCH API -> returns Freebase data given a free text user query.
  • MQL Services (mqlread & mqlwrite) allow performing structured queries on Freebase using MQL. (This is the most common way to access graph data and to ask questions)
  • TEXT Service -> takes an ID of a topic, returns its description
  • IMAGE Service -> takes an ID, returns an image
  • need to obtain an API Key - unique key generated using the console (on Google account, API console, create project)
    • The project passes key (key=(API_KEY))
  • Limit -> read quota of 100k per day, write 10k.
    • for higer quota, do request more on google
    • quotas on sandbox are more, but sandbox is erased every sunday!
    • data dumps may be used locally for more limit (the size is 14 GB as i remember)
  • depends on Google API client libraries
API Services:
  • Search -> find entities by keyword search
  • MQL Read -> retrieve detailed structured data about entities or collections of entities
  • Topic API -> get a summary of all the info for an entity
  • RDF API ->  get a summary of all the info for an entity in RDF
  • Text Service -> get short textual descriptions for entities
  • Image Service -> get repr. thumbnails for entities
  • Freebase Suggest -> UI Widget picking entities
URI pattern for an API call:
GET https://www.googleapis.com/freebase/<version>/<apiname>[<path>]? [<urlparams>]

if request query is too long, params should be passed via POST.

but X-HTTP-Method-Override: GET header must be added to request.
version is v1 for production, v1sandbox for sandbox environment (experimental)

callback -> url param will return a json structure enclosed in a javascript function call as an argument to the function (supports JSONP pattern)

Freebase API Sample Code Generator (http://codify.freebaseapps.com/) -> strongly recommend to try this!

2 Mayıs 2013 Perşembe

multiple reports in one viewer - telerik reports

My requirement is to view several reports in one report viewer as follows:


In order to view multiple (4 in this case) reports in one report viewer:


            ReportBook rb = new ReportBook();
            rb.Reports.Add(new SauOgrisReport());
            rb.Reports.Add(new SauOgrisReport());
            rb.Reports.Add(new SauOgrisReport());
            rb.Reports.Add(new SauOgrisReport());

            ReportViewer viewer =          (ReportViewer)this.ReportContent.Controls[0];

            viewer.Report = rb;
            viewer.RefreshReport();

28 Nisan 2013 Pazar

23 Nisan 2013 Salı

couchdb + django

http://lethain.com/an-introduction-to-using-couchdb-with-django/ is an excellent tutorial for integrating couchdb with django..
(couchdb version 0.8, django version 1.5 on Windows 7)
In order to succesfully run the example, i did the following:

- if you get the error,
cannot import name ResourceNotFound,
edit couch_docs/view.py as follows:
from couchdb.client import ResourceNotFound

- if you get the error,
AssertionError at / The XView middleware requires authentication middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.auth.middleware.AuthenticationMiddleware'.

do what it says..

- if you get the error,
The Django authentication middleware requires session middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.sessions.middleware.SessionMiddleware'.

do what it says.. settings.py becomes as follows:


MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.middleware.doc.XViewMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)


- if you get the error,
Error importing template source loader django.template.loaders.filesystem.load_template_source: "'module' object has no attribute 'load_template_source'"

update settings.py as follows:


TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
#     'django.template.loaders.eggs.Loader',
)

After the above fixes, the example worked for me..

21 Nisan 2013 Pazar

to add linkedin login button to blog page

This post is actually part-2 of the previous post ( http://hilaltarakci.blogspot.com/2013/04/to-add-facebook-login-button-to-blog.html ) in which a facebook login button is added to blogger.

i followed the steps in http://developer.linkedin.com/documents/getting-started-javascript-api and successfully added a linkedin login button to blog http://ucasfumproject.blogspot.com/.

To accomplish this:
- create a linkedin application and remember to specify the blog address as the JavaScript API Domain (step 2 in  http://developer.linkedin.com/documents/getting-started-javascript-api)

- login to blogger dashboard
go templates >> edit HTML
- right below the closing head tag, copy the following:

- go layout >> add a gadget and add an HTML/Javascript  gadget as follows: