1

Is it possible to import an rdf file from a URL into Swish?

I.e. something like:

myload:- load_rdf('www.myrdf.com').

Then I could query ?-rdf(A,B,C)

SQB
  • 3,926
  • 2
  • 28
  • 49
user27815
  • 4,767
  • 14
  • 28

1 Answers1

0

With the Semweb package and using Swi-Prolog locally, it's easy:

use_module(library(semweb/rdf11)).

use_module(library(semweb/rdf_http_plugin)).

rdf_load('http://dbpedia.org/resource/Amsterdam').
% Parsed "http://dbpedia.org/resource/Amsterdam" in 0.13 sec; 5,120 triples
MacHeath
  • 108
  • 7
  • This does not work in swish - the online swi prolog. – user27815 Apr 21 '17 at 08:12
  • You're right. Swish is a small subset of Prolog and apparently doesn't load the semweb packages. When I try `use_module(library(semweb/rdf11)).` (or `rdf_db`) it returns true but `rdf/3` doesn't exist. – MacHeath Apr 26 '17 at 12:33