SlideShare a Scribd company logo
RDF APIs for .NET Framework

              Rata Gheorghita Mugurel MOC2, Ivanciu Adriana MLC2
                              gheorghita.rata@infoiasi.ro, adriana.ivanciu@infoiasi.ro


       The RDF (Resource Description Framework) is a structure for
describing and interchanging metadata on the Web. RDF provides a
consistent framework and syntax for describing and querying data
(Personal RDF).


DRIVE RDF API

       According to Shelley, one of the first RDF API for C# is
DRIVE. It consists in dll file (drive.dll) that must be located in project
bin directory. The project should have the correct references to the dll.
       This API is providing three major classes:
1. Softagents.Drive.RDFEdge – represent an edge in a RDF graph.
  Such an object includes a source node (m_Sourcenode) and a
  destination node (m_Destnode).
2. Softagents.Drive.RDFGraph – this kind of object is able to store and
  manage the RDF graph
3. Softagents.Drive.RDFNode – represent a node in the RDF graph. It
  includes a variable that contains all the edges associated with the
  node (m_Edges), some methods that manipulate the graphs elements
  such as getEdges(), getIncomingEdges(), … .
       To work with a RDF graph we should first create an instance of
RDFGraph, reading in an RDF/XML document. Once it is read in, we
2   Rata Gheorghita Mugurel MOC2, Ivanciu Adriana MLC2


can query information from the graph, such as accessing a node with a
URI and then querying for the edges related to that node. I’ll show in
the next paragraph the example given by Shelley in its book. It’s
printing out the edges for a given node.

    using System;

    using Softagents.Drive;

    using System.Collections;

    namespace PracticalRDF

    {

               Public class PracticalRDF

    {

               Static void Main (string[] args)

               {

                   String[] arrNodes;

                   if(args.Length <1)

                   {

                       Console.WriteLine(“Not correct input
    file”);

                       Return;

    }

    //read in RDF/XML document

    RDFGraph rg = new RDFGraph();
RDF APIs for .NET Framework   3


  Rg.BuildRDFGraph(args[0]);

  //find specific node

  RDFNode rNode = rg.GetNode(“here will be an
  URI”);

  System.Collections.ArrayList arrEdges =
  rNode.GetEdges();

  //access edges and print

  Foreach(RDFEdge rEdge in arrEdges){

  Console.WriteLine(rEdge.m_lpszNameSpace +
  rEdge.m_lpszEdgeLocalName);

  }

  //dump all N-Triples

  Rg.PrintNTruples();

  }

  }

  }
       Unfortunately, because the drive.dll cannot be found in the
specified sources, I cannot test it myself.
       The only source for information about Drive was Shelley’s
document. So, the support for developers is practical zero. Also Drive
doesn’t offer support for processing data using a query language.


Drive RDF library should be found at http://www.driverdf.org/.
4    Rata Gheorghita Mugurel MOC2, Ivanciu Adriana MLC2


Semantic Web/RDF Library for C#/.NET

         Another RDF API for .NET Framework is Semnatic Web,
initially developed in 2005 by Joshua Tauberer. It continued his work
on this library till present. This is an open source library developed
under GNU GPL license.
         Example of web applications that use SemWeb: ROLEX
(http://rowlex.nc3a.nato.int),       F-Spot     (http://f-spot.org)   –   photo
management, Beagle (http://beagle-project.org), Sentient Knowledge
explorer (http://www.io-informatics.com/products/sentient-KE.html).
         Semantic Web it is well documented and it is dived as follow:


Basic documentation
       (http://razor.occams.info/code/semweb/semweb-
     current/doc/index.html)


API documentation
      (http://razor.occams.info/code/semweb/semweb-
         current/apidocs/index.html)


Example Programs
      (http://razor.occams.info/code/repo/?/semweb/examples)
         SemWeb is based on two keywords: Resources and Statements.
 Resources it’s the abstract base class of the terms in RDF which has
    two subclasses: Entity and Literal.. The nodes are object of the entity
    class. Those nodes can be empty or can contain a name (URI).
 A statement is in fact a RDF Triple, and can be defined as follows:

    new Statement(
RDF APIs for .NET Framework    5


          new
  Entity(“http://www.example.org/SemWeb”),

          new
  Entity(“http://www.example.org/hasName”),

          new Literal(“My semantic Web
  LIbrary”));
        If we want to instantiate a blank node we have to replace the
Literal instance with “new Bnode()” (which represents an instance
of an empty Literal).
        I’ll show an example for how to get the statements from an
object stored in computer memory.

      MemoryStore ms = new MemoryStore();

  for(int i=0; i<ms.StatementsCount; i ++) //( I
  replaced ms++ from the initial document with
  i++; the original line doesn’t make sense)

  Statement stmr = ms[i];

  Console.WriteLine(stmt);

  }
        It also offers support for query languages. It must be included
the SemWeb.Query Namespace. The SPARQL specifications are
implemented in SemWeb.Query.Sparql. It has implemented an
algorithm for graph matching in SemWeb.Query.GraphMatch.
6   Rata Gheorghita Mugurel MOC2, Ivanciu Adriana MLC2


GreenGrass RDF API for C#

        Greengrass provide a high-level API that allows the RDF
triples to be parsed, stored and manipulated. It works with CRL
compiled languages, C#, VB.NET, …
        It is released under LPGL license and it’s independent of
operating systems. It is implemented in C# and it was released for the
first time in 2007.
        The documentation is also practically nonexistent. I tried to
obtain some information directly from the source code that can be
downloaded from softpedia at
(http://linux.softpedia.com/progDownload/Greengrass-Download-
32460.html).
        It has the same structure as the previous API. It contains a class
Node that offers some methods for:
    -   creating a resource node – CreateResource(…) (having an
        URI parameter – string or URI type);
    -   creating a blank node - CreateBlank();
    -   creating a literal – CreateLiteral() (having a data
        parameter, type string);
        GreenGrass has support for query languages. It also contains
an algorithm for managing graphs, but the support for SPARQL is
nonexistent.
RDF APIs for .NET Framework   7


Conclusions

          The best RDF API for .NET is the second one - SemanticWeb
because it offers support both for SPARQL and Graphs. SemanticWeb
has a good structured documentation and the authors still offer
technical support, fix bugs and updates the library to the last web
trends.
8    Rata Gheorghita Mugurel MOC2, Ivanciu Adriana MLC2


Bibliografy:
1. Practical RDF, Shelley Powers, O’Reilly,
    http://books.google.com/books?id=88yzElvD9sgC&printsec=frontco
    ver&dq=Practical+RDF#v=onepage&q=&f=false
2. Semantic Web/RDF Library for C#/.NET, Joshua Tauberer
3. http://razor.occams.info/code/semweb
4. http://freshmeat.net/projects/greengrass
5. http://linux.softpedia.com/progDownload/Greengrass-Download-
    32460.html

More Related Content

PPTX
Semantic web meetup – sparql tutorial
PPTX
A Little SPARQL in your Analytics
PPTX
PDF
Two graph data models : RDF and Property Graphs
PDF
Linking the world with Python and Semantics
PPTX
SWT Lecture Session 3 - SPARQL
PDF
Querying Linked Data with SPARQL
PDF
An Introduction to SPARQL
Semantic web meetup – sparql tutorial
A Little SPARQL in your Analytics
Two graph data models : RDF and Property Graphs
Linking the world with Python and Semantics
SWT Lecture Session 3 - SPARQL
Querying Linked Data with SPARQL
An Introduction to SPARQL

What's hot (20)

PPTX
SPARQL Cheat Sheet
PPTX
SPIN in Five Slides
PPTX
RDFa Tutorial
PPTX
SWT Lecture Session 2 - RDF
PDF
Tutorial "An Introduction to SPARQL and Queries over Linked Data" Chapter 2 (...
PPT
Facet: Building Web Pages with SPARQL
PDF
Graph Analytics with ArangoDB
ZIP
XSLT+SPARQL: Scripting the Semantic Web with SPARQL embedded into XSLT styles...
PDF
The Semantics of SPARQL
PDF
WebTech Tutorial Querying DBPedia
PPTX
Introduction to dotNetRDF
PPT
Rdf Overview Presentation
ODP
Graph Data -- RDF and Property Graphs
PDF
Jesús Barrasa
PPTX
SWT Lecture Session 9 - RDB2RDF direct mapping
PPTX
SWT Lecture Session 11 - R2RML part 2
PDF
RDF, SPARQL and Semantic Repositories
PPTX
SWT Lecture Session 10 R2RML Part 1
PPTX
SHACL: Shaping the Big Ball of Data Mud
SPARQL Cheat Sheet
SPIN in Five Slides
RDFa Tutorial
SWT Lecture Session 2 - RDF
Tutorial "An Introduction to SPARQL and Queries over Linked Data" Chapter 2 (...
Facet: Building Web Pages with SPARQL
Graph Analytics with ArangoDB
XSLT+SPARQL: Scripting the Semantic Web with SPARQL embedded into XSLT styles...
The Semantics of SPARQL
WebTech Tutorial Querying DBPedia
Introduction to dotNetRDF
Rdf Overview Presentation
Graph Data -- RDF and Property Graphs
Jesús Barrasa
SWT Lecture Session 9 - RDB2RDF direct mapping
SWT Lecture Session 11 - R2RML part 2
RDF, SPARQL and Semantic Repositories
SWT Lecture Session 10 R2RML Part 1
SHACL: Shaping the Big Ball of Data Mud
Ad

Similar to RDF APIs for .NET Framework (20)

PDF
.Net and Rdf APIs
PDF
Rdf Processing On The Java Platform
PDF
Comparative study on the processing of RDF in PHP
PDF
Comparative Study That Aims Rdf Processing For The Java Platform
ODP
State of the Semantic Web
PDF
PPTX
Triplestore and SPARQL
PDF
Modern PHP RDF toolkits: a comparative study
PDF
RDF and Java
PPTX
Hacia la Internet del Futuro: Web Semántica y Open Linked Data, Parte 2
PDF
Rdf Processing Tools In Java
PDF
GraphTech Ecosystem - part 1: Graph Databases
PDF
Deploying PHP applications using Virtuoso as Application Server
PPTX
A year on the Semantic Web @ W3C
PDF
Apache Spark Introduction
PDF
RDF_API_Java_Stefan_Apostoaie
PDF
Sparql semantic information retrieval by
PPT
Semantic web
PDF
SPARQL: SEMANTIC INFORMATION RETRIEVAL BY EMBEDDING PREPOSITIONS
PPTX
Jena Programming
.Net and Rdf APIs
Rdf Processing On The Java Platform
Comparative study on the processing of RDF in PHP
Comparative Study That Aims Rdf Processing For The Java Platform
State of the Semantic Web
Triplestore and SPARQL
Modern PHP RDF toolkits: a comparative study
RDF and Java
Hacia la Internet del Futuro: Web Semántica y Open Linked Data, Parte 2
Rdf Processing Tools In Java
GraphTech Ecosystem - part 1: Graph Databases
Deploying PHP applications using Virtuoso as Application Server
A year on the Semantic Web @ W3C
Apache Spark Introduction
RDF_API_Java_Stefan_Apostoaie
Sparql semantic information retrieval by
Semantic web
SPARQL: SEMANTIC INFORMATION RETRIEVAL BY EMBEDDING PREPOSITIONS
Jena Programming
Ad

Recently uploaded (20)

PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Pharma ospi slides which help in ospi learning
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Pre independence Education in Inndia.pdf
PPTX
Institutional Correction lecture only . . .
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Computing-Curriculum for Schools in Ghana
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Sports Quiz easy sports quiz sports quiz
PDF
RMMM.pdf make it easy to upload and study
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Basic Mud Logging Guide for educational purpose
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Pharmacology of Heart Failure /Pharmacotherapy of CHF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Pharma ospi slides which help in ospi learning
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Pre independence Education in Inndia.pdf
Institutional Correction lecture only . . .
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Computing-Curriculum for Schools in Ghana
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Final Presentation General Medicine 03-08-2024.pptx
Sports Quiz easy sports quiz sports quiz
RMMM.pdf make it easy to upload and study
Anesthesia in Laparoscopic Surgery in India
Supply Chain Operations Speaking Notes -ICLT Program
Basic Mud Logging Guide for educational purpose

RDF APIs for .NET Framework

  • 1. RDF APIs for .NET Framework Rata Gheorghita Mugurel MOC2, Ivanciu Adriana MLC2 gheorghita.rata@infoiasi.ro, adriana.ivanciu@infoiasi.ro The RDF (Resource Description Framework) is a structure for describing and interchanging metadata on the Web. RDF provides a consistent framework and syntax for describing and querying data (Personal RDF). DRIVE RDF API According to Shelley, one of the first RDF API for C# is DRIVE. It consists in dll file (drive.dll) that must be located in project bin directory. The project should have the correct references to the dll. This API is providing three major classes: 1. Softagents.Drive.RDFEdge – represent an edge in a RDF graph. Such an object includes a source node (m_Sourcenode) and a destination node (m_Destnode). 2. Softagents.Drive.RDFGraph – this kind of object is able to store and manage the RDF graph 3. Softagents.Drive.RDFNode – represent a node in the RDF graph. It includes a variable that contains all the edges associated with the node (m_Edges), some methods that manipulate the graphs elements such as getEdges(), getIncomingEdges(), … . To work with a RDF graph we should first create an instance of RDFGraph, reading in an RDF/XML document. Once it is read in, we
  • 2. 2 Rata Gheorghita Mugurel MOC2, Ivanciu Adriana MLC2 can query information from the graph, such as accessing a node with a URI and then querying for the edges related to that node. I’ll show in the next paragraph the example given by Shelley in its book. It’s printing out the edges for a given node. using System; using Softagents.Drive; using System.Collections; namespace PracticalRDF { Public class PracticalRDF { Static void Main (string[] args) { String[] arrNodes; if(args.Length <1) { Console.WriteLine(“Not correct input file”); Return; } //read in RDF/XML document RDFGraph rg = new RDFGraph();
  • 3. RDF APIs for .NET Framework 3 Rg.BuildRDFGraph(args[0]); //find specific node RDFNode rNode = rg.GetNode(“here will be an URI”); System.Collections.ArrayList arrEdges = rNode.GetEdges(); //access edges and print Foreach(RDFEdge rEdge in arrEdges){ Console.WriteLine(rEdge.m_lpszNameSpace + rEdge.m_lpszEdgeLocalName); } //dump all N-Triples Rg.PrintNTruples(); } } } Unfortunately, because the drive.dll cannot be found in the specified sources, I cannot test it myself. The only source for information about Drive was Shelley’s document. So, the support for developers is practical zero. Also Drive doesn’t offer support for processing data using a query language. Drive RDF library should be found at http://www.driverdf.org/.
  • 4. 4 Rata Gheorghita Mugurel MOC2, Ivanciu Adriana MLC2 Semantic Web/RDF Library for C#/.NET Another RDF API for .NET Framework is Semnatic Web, initially developed in 2005 by Joshua Tauberer. It continued his work on this library till present. This is an open source library developed under GNU GPL license. Example of web applications that use SemWeb: ROLEX (http://rowlex.nc3a.nato.int), F-Spot (http://f-spot.org) – photo management, Beagle (http://beagle-project.org), Sentient Knowledge explorer (http://www.io-informatics.com/products/sentient-KE.html). Semantic Web it is well documented and it is dived as follow: Basic documentation (http://razor.occams.info/code/semweb/semweb- current/doc/index.html) API documentation (http://razor.occams.info/code/semweb/semweb- current/apidocs/index.html) Example Programs (http://razor.occams.info/code/repo/?/semweb/examples) SemWeb is based on two keywords: Resources and Statements.  Resources it’s the abstract base class of the terms in RDF which has two subclasses: Entity and Literal.. The nodes are object of the entity class. Those nodes can be empty or can contain a name (URI).  A statement is in fact a RDF Triple, and can be defined as follows: new Statement(
  • 5. RDF APIs for .NET Framework 5 new Entity(“http://www.example.org/SemWeb”), new Entity(“http://www.example.org/hasName”), new Literal(“My semantic Web LIbrary”)); If we want to instantiate a blank node we have to replace the Literal instance with “new Bnode()” (which represents an instance of an empty Literal). I’ll show an example for how to get the statements from an object stored in computer memory. MemoryStore ms = new MemoryStore(); for(int i=0; i<ms.StatementsCount; i ++) //( I replaced ms++ from the initial document with i++; the original line doesn’t make sense) Statement stmr = ms[i]; Console.WriteLine(stmt); } It also offers support for query languages. It must be included the SemWeb.Query Namespace. The SPARQL specifications are implemented in SemWeb.Query.Sparql. It has implemented an algorithm for graph matching in SemWeb.Query.GraphMatch.
  • 6. 6 Rata Gheorghita Mugurel MOC2, Ivanciu Adriana MLC2 GreenGrass RDF API for C# Greengrass provide a high-level API that allows the RDF triples to be parsed, stored and manipulated. It works with CRL compiled languages, C#, VB.NET, … It is released under LPGL license and it’s independent of operating systems. It is implemented in C# and it was released for the first time in 2007. The documentation is also practically nonexistent. I tried to obtain some information directly from the source code that can be downloaded from softpedia at (http://linux.softpedia.com/progDownload/Greengrass-Download- 32460.html). It has the same structure as the previous API. It contains a class Node that offers some methods for: - creating a resource node – CreateResource(…) (having an URI parameter – string or URI type); - creating a blank node - CreateBlank(); - creating a literal – CreateLiteral() (having a data parameter, type string); GreenGrass has support for query languages. It also contains an algorithm for managing graphs, but the support for SPARQL is nonexistent.
  • 7. RDF APIs for .NET Framework 7 Conclusions The best RDF API for .NET is the second one - SemanticWeb because it offers support both for SPARQL and Graphs. SemanticWeb has a good structured documentation and the authors still offer technical support, fix bugs and updates the library to the last web trends.
  • 8. 8 Rata Gheorghita Mugurel MOC2, Ivanciu Adriana MLC2 Bibliografy: 1. Practical RDF, Shelley Powers, O’Reilly, http://books.google.com/books?id=88yzElvD9sgC&printsec=frontco ver&dq=Practical+RDF#v=onepage&q=&f=false 2. Semantic Web/RDF Library for C#/.NET, Joshua Tauberer 3. http://razor.occams.info/code/semweb 4. http://freshmeat.net/projects/greengrass 5. http://linux.softpedia.com/progDownload/Greengrass-Download- 32460.html