- From: Simon Price <simon.price@bristol.ac.uk>
- Date: Fri, 02 Jun 2006 11:16:04 +0100
- To: tim.glover@bt.com
- CC: danbri@danbri.org, cff@di.uevora.pt, chris.dollin@hp.com, semantic-web@w3.org
Tim's right. SWI's semweb module will let you do something like load_rdf('myfoaf.rdf') which parses the RDF in as triples accesible via the rdf/3 and rdf/4 predicates. You can load ontologies in the same way because they're just rdf files. As for reasoners, you can look in the semweb module to see what kind of reasoning is implemented but its pretty easy to roll your own in prolog of course. Instead for my foaf work, which has fairly modest requirements for inference, I wrote a generator that pre-calculates all the logically entailed triples, asserting the inherited/inferred properties and subproperties as explicit predicates. This effectively maps from rdf triples to prolog terms for each rdf class. The upside of my approach is a human-readable prolog representation of your data. The downside is that your code gets locked into static representations of objects/classes which is a bit un-semantic web. In hindsight I'd probably stick with the raw rdf/3 predicate if starting the project again. But in summary SWI has fantastic support for RDF and XML/SGML in general although it is an in-memory model so is restricted to around 40M triples or something of that order. You can also connect, in theory at least (I've not tried it myself yet), to Jena or Redland too for more capacity. Cheers Simon tim.glover@bt.com wrote: > > I believe SWI prolog has RDF and OWL parsers built in, together with RDF > and OWL reasoners. > > Tim. > > > > -----Original Message----- > From: semantic-web-request@w3.org [mailto:semantic-web-request@w3.org] > On Behalf Of Dan Brickley > Sent: 01 June 2006 15:41 > To: Cl?udio Fernandes > Cc: Chris Dollin; semantic-web@w3.org > Subject: Re: xlst and rdf/owl > > > * Cl?udio Fernandes <cff@di.uevora.pt> [2006-06-01 15:31+0100] > >>On Thu, 2006-06-01 at 15:05 +0100, Chris Dollin wrote: >> >>>On Thursday 01 June 2006 14:36, you wrote: >>> >>> >>>>I've been working with xslt lately, great tool. But the question > > is: can > >>>>I use it to parse rdf/owl? I tried to, but all I get is parsing > > errors > >>>>from '<rdf:' or '<owl:' tags. >>> >>>You /can/ use XSLT to parse RDF/OWL. But if you want to process the >>>RDF/OWL /as/ RDF or OWL, is XSLT the right tool for the job? >>> >> >>Actually I want to process rdf/owl to generate Prolog predicates, > > which > >>means I don't want to generate another tree, and I need some > > formatting > >>capacities. >> >>Right now I'm doing it with the expat lib. I parse the document and >>forward a big term to Prolog, which will generate the desired .pl. >>However, it seems that if I could do this with xslt, my life would be >>easier :) > > > OK, look around for one of the XSLT parsers that generates 'n-triples' > or N3 format. These are prolog-like. It can be done... > > Dan > > -- Simon Price http://www.ilrt.bris.ac.uk/aboutus/staff?search=ecsnp
Received on Friday, 2 June 2006 10:16:28 UTC