Coder Social home page Coder Social logo

ktp-forked-repos / swipy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wwaites/swipy

0.0 1.0 0.0 348 KB

SWI Prolog Python Bindings and RDFLib Store

Home Page: http://github.com/wwaites/swipy

License: GNU General Public License v3.0

Python 5.80% Prolog 94.20%

swipy's Introduction

== Python bindings for SWI-Prolog ==
   ... and store for RDFLib

This packages provides a generic interface to the SWI Prolog from
Python. The main motivation for it was the promise of a reasoning
RDF store that could be used with RDFLib.

is similar to the similarly named package pyswip except that pyswip
pyswip uses ctypes to interface with the SWI-Prolog shared library
and we build a C module using Cython.

The package provides two modules, the first, `swi' contains the
low-level interface to prolog. The second `swipy' provides the
store that is compatible with RDFLib. To this end it bundles 
the SeRQL package from Clio Patria which provides a SPARQL query
interface with entailment and the Henry package which provides
Notation 3 parsing and entailment.

== Installing ==

Requirements:

	* SWI-Prolog 3.8.0 or newer
	* Cython version 0.12 or newer
	* RDFLib 2.5 or SVN (for using the RDFLib Store)

On Mac OSX or other BSD systems it should be sufficient to install
SWI-Prolog from the ports (macports) tree. This is the case as 
well on Gentoo Linux which uses a similar packaging infrastructure.

I have not had very much success on Debian and Debian based 
systems such as Ubuntu Linux with the pre-packaged binaries. It
is recommended to build SWI-Prolog from source in this case.

If you intend to use the RDF store's native (SeRQL) SPARQL query
interface or the Henry N3 entailment modules it is important to
build SWI-Prolog with the XPCE package. XPCE contains the regex
routines used by the serql(sparql) and henry(n3_load).

Make sure `swipl' or `pl' is in your path, then,

	python setup.py build
	python setup.py install

== Testing ==

	nosetests -v -s tests

	## and look at some of the test cases for ideas how
	## to use

== Using ==

	from swipy.store import SWIStore
	from rdflib.graph import Graph

	g = Graph(SWIStore())
	g.store.entailment = "n3"

	etc ...

Note that there are essentially two modes of operation of the
store, `normal' where it behaves like any named graph aware 
store and `entailing' which is enabled by setting the entailment
property on the store object to a non-null value (the name of
one of the entailment modules). If entailment is enabled triples
are returned from the entire store -- ignoring which graph they
may belong to.

swipy's People

Watchers

Tadeusz Kurpiel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.