Store Semantic Web Triples into Cassandra

Table of contents
Reading Time: 2 minutes

The semantic web is the next level of  Web Searching where data is more important and it should be well defined. The semantic web is needed for making the web search more intelligent and intuitive to get the user’s requirement. You all can find some interesting point on the Semantic Web here.

Triples is an atomic entity in RDF. It is composed of subject-predicate-object. It is used for linking the object (Subject & Object) with the help of Predicate. You all can find some interesting point on the Triples here.

RDF stands for Resource Description Framework, It is a framework which is used for representing all information about the source into the graph. RDF store is used for storing the triples and uses SPARQL query to run it where in RDF store it creates some tables and on the basis of those tables it converts SPARQL query into the normal SQL queries and for that, it uses Quetzal.

Now there will be some questions and one of them is: What are we doing here?

We are trying to store the Triples into Cassandra as Quetzal stores into Postgres after creating the tables. Quetzal creates lots of table for storing the Triples on the basis of certain conditions. Tables which is created by the Quetzal:

  1. kb
  2. kb_basestats
  3. kb_direct_preds
  4. kb_dph
  5. kb_ds
  6. kb_dt
  7. kb_lstr
  8. kb_reverse_preds
  9. kb_rph
  10. kb_rs
  11. kb_topkstats

For more information of these tables, you can visit here.

We are trying to implement kb_direct_preds & kb_dph tables on the Cassandra and fetch the object with the help of subject and predicate.

Table kb_direct_preds is used for storing the location of the predicate in the kb_dph table while kb_dph stores every value of the triples along with subject, predicate & object.

Ingest Data into Cassandra

We have to follow these steps to insert the data into the table:

  • Apache Cassandra running on default port [i.e. 9042]

Fetch Data From Cassandra

We have to follow these step to fetch out the data from the Cassandra table:

    • Run project using the command:
    • After running the project, hit the endpoint from your browser:

You can find more information from the wiki of the project.

We have submitted the template of the project. You can find template with this command:

These are the steps for storing triples into a kb_dph table with the help of kb_direct_preds.

If You have any questions you can comment us here or contact us on:

Github: Triple Manipulation

Twitter: @anuragknoldus, @akashsethi24, @charmygarg




Written by 

Anurag is the Sr. Software Consultant @ Knoldus Software LLP. In his 3 years of experience, he has become the developer with proven experience in architecting and developing web applications.

2 thoughts on “Store Semantic Web Triples into Cassandra2 min read

Comments are closed.