DBpedia D2R Server R2R Silk LDIF NG4J Marbles WIQA Pubby RAP
Open Source projects by the Web-based Systems Group:  

 RDF Logo  PHP Logo SourceForge Logo


RAP - RDF API for PHP V0.9.6

RAP is a software package for parsing, querying, manipulating, serializing and serving RDF models.

Its features include:

For further information about RAP see:

Download and Installation

  1. Download the current version from: http://sourceforge.net/projects/rdfapi-php/
  2. Unpack the zip file.
  3. Include RDF API into your scripts:
    • define("RDFAPI_INCLUDE_DIR", "C:/Apache/htdocs/rdf_api/api/");
    • include(RDFAPI_INCLUDE_DIR . "RDFAPI.php");
  4. Change the constant RDFAPI_INCLUDE_DIR to the directory in which you have unpacked the zip file.

RAP can be used with PHP 4 or PHP 5.

  • When used with PHP 4 it requires at least version 4.2
  • When used with PHP 5 it requires at least version 5.0.1


Status of the code

Version Comment Release Date
V0.9.6 RAP_Pubby - a linked data frontend for RAP added.
Multiple bugs fixed.

New SPARQL query engine added. The new engine is much faster and supports
all features of the W3C SPARQL recommendation.
Multiple bugs fixed.


SPARQL client library added.
RSS parser added.
Updated ADODB database abstraction layer to the current version.
Unit test suite extended.
Multiple bugs fixed.


Support for the SPARQL query language and a subset of SPARQL protocol added.
Multiple bugs fixed.


Support for Named Graphs and RDF dataset added.
Graph visualization modul added.
Multiple bugs fixed.


GRDDL parser added.
Improved RDF/XML namespace handling.
Option to create models using RDQL added.
RDF DB Utils bugs fixed.
Improved common vocabulary support.
RSS, FOAF, ATOM vocabularies added.


Resource-centric ResModel API added.
Ontology-centric OntModel API added.
InfModelF and InfModelB inference engine added.
RDF DB Utils added.
RAP Unit Test Suite extended.


New MemModel indexing speeding up searches.
Dynamic script inclusion speeding up many operations.
New FindIterator() class added.
RAP Unit Test Suite added.
Multiple bugs fixed.


RDF server supporting the RDF NetAPI added.
RDQL syntax updated according to the W3C member submission.
Multiple bug fixes.

V0.7.1 Multiple bugs fixed.
Support for XML default namespace (xmlns="uri_namespace").

Improved RDF, N3 and N-Triple parsers and serializers.
Support for the "RDF/XML Syntax Specification (Revised) -
W3C Working Draft 10 October 2003".
RDQLResultIterator added.


Database backend, rdql and n3 support added.

V0.5 Parser and model operations are much faster now.
Search index and some convenience methods added.
V0.4 Support for common vocabularies and StatementIterator object added. 2003-02-20
V0.3 Support for rdf:datatype and rdf:nodeID added. 2003-01-13
V0.2 Some bugs fixed.
Documentation updated.
V0.1 Initial Release. 2002-09-24



RAP is an open source project and we highly welcome any kind of useful external contributions.

Lots of thanks to

  • Christian Weiske for reimplementing the RAP SPARQL engine and extending it with support for all features from the W3C SPARQL Recommendation
  • Daniel Westphal for the ResModel- and OntModel-APIs, RDF dataset and the RDF-S/OWL reasoning support.
  • Radoslaw Oldakowski for the database backend, the RDQL query engine, improving the RDF/XML-parser, and for the RAP_Pubby
  • Gunnar AA. Grimnes for the N3 support and the RDF DB Utils package
  • Phil Dawes for the NetAPI implementation
  • Tobias Gauß for the MemModel indexing, the unit test suite and the SPARQL engine and client library.
  • Anton Köstlbacher for the graph visualization.
  • Lukas Smith, Sören Auer, Leandro Mariano Lopez, Riccardo Catanzani, Scott Willy for multiple bug reports and fixes.

Mailing List

Please send:

+ general questions about RAP
+ feature requests
+ links to interesting RAP use cases

to the RAP mailing list rdfapi-php-interest@lists.sourceforge.net

You can subscribe rdfapi-php-interest and scroll through the mailing list archives under http://lists.sourceforge.net/lists/listinfo/rdfapi-php-interest

Other feedback can also be send directly to: chris@bizer.de (Chris Bizer)

Bug Tracker

Please report bugs (maybe together with a patch) to the RAP bug tracker:


Open issues

There are some open issues and future ideas which await implementation.
So if you want to contribute some code to RAP, our Open Issues list might give you some valuable ideas :-)

Other RDF tools for PHP

  • Section on PHP in Developers Guide to Semantic Web Toolkits for different Programming Languages
  • R2D2 RDF to Database too. University Leipzig project implementing the D2RQ relational database to RDF mapping language in PHP. R2D2 allows you to treat legacy databases as RDF graphs and to query these graphs.
  • pOWL (Sören Auer): Webbased OWL editor and OWL API based on RAP.
  • appmosphere RDF classes (Benjamin Nowack): Lightweight RDF parser and N-Triples serializer.
  • SimpleRdfParser (Morten Frederiksen): A wrapper class around the RAP rdf parser, which parses RDF into a simple array. The SimpleRdfParser is faster than the RAP parser because it doesn't use the rest of the RAP library.
  • Rdfworld.php (Chris Snyder): Rdfworld.php is an RDF to PHP object converter, inspired by Aaron Swartz's TRAMP for Python.
    It allows PHP developers to convert RDF Resources into PHP objects with appropriate properties. The converter is based on RAP V0.3.
  • PHP XML Classes (Luis Argerich): XML/RDF package including RDF parser, storage mechanism and RDQL query interface. The RAP rdf parser is an up-to-date version of the rdf parser from this package. Luis' parser and RDQL query engine haven't been changed for 2 years and don't reflect the current RDF specification any more.
  • rdftp (Vangelis Vassiliadis): rdftp is an RDF server implemented as a PHP script that supports Query and Update operations on RDF content.