Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "rdfs2pl"

Title:Compile an RDFS schema to prolog predicates
Rating:Not rated. Create the first rating!
Latest version:0.0.3
SHA1 sum:07d146bebabe992b923a555e6fab7be59c3ffa7d
Author:Chris Mungall <cmungall@gmail.com>
Home page:https://github.com/cmungall/rdfs2pl
Download URL:https://github.com/cmungall/rdfs2pl.git

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
0.0.1947c6c7c2711bde2a966b5b3cc82756aef5b7b411https://github.com/cmungall/rdfs2pl.git
0.0.2ae7a2db571c4ab782b4bf6b5aea33219e73a83372https://github.com/cmungall/rdfs2pl.git
0.0.307d146bebabe992b923a555e6fab7be59c3ffa7d19https://github.com/samer--/rdfs2pl.git

Synopsis

:- ensure_loaded( library(rdfs2pl) ).
:- use_module(library(semweb/rdf_db)).

gen :-
        pizzans(URL),
        rdf_load('pizza.owl'),
        tell('pizza.pl'),
        write_schema(pizza,'http://owl.cs.manchester.ac.uk/2009/07/sssw/pizza#',[use_labels(true)]),
        told.

Description

Compiles an RDFS schema to prolog wrapper predicates. For example, if the ontology contains

:hasTopping a owl:ObjectProperty ;
    rdfs:label "has topping" .

Then the generated module will contain

:- rdf_meta has_topping(r,r).
:- op(300,xfy,has_topping/2).
has_topping(X,Y) :- rdf_has(X,pizza:hasTopping,Y).

A unary predicate is also created for every class

This allows convenient querying of the form:

write_pizza_toppings :-
    pizza(P),
    P has_topping T,
    writeln(P-T),
    fail.

Installation

?- pack_install(rdfs2pl).

Source code available and pull requests accepted at http://github.com/cmungall/rdfs2pl

Contents of pack "rdfs2pl"

Pack contains 6 files holding a total of 604K bytes.