SWI-Prolog Semantic Web Library
Abstract
The semweb library provides a Prolog library based on foreign-language extensions for storing and manipulating RDF triples. It can handle quite large sets of triples only limited by available memory. One million triples requires about 80MB memory, so a fully equiped 32-bit machine can handle about 25 million triples. A 64-bit machine with 32Gb memory (just a few thousand euros in june 2009) can handle up to 150 million triples.
Prerequisites
This library depends on the RDF parser library which in turn depends on the XML parser provided by the sgml package.
Further info
This library defines the semantic web infrastructure for SWI-Prolog. The library is documented in semweb.pdf or the equivalent semweb.html. If your installation does not include this file, please visit http://www.swi-prolog.org/packages/
Staying up-to-date
This library is under active development. The recent version can be accessed from the GIT repository under the directory pl/packages/semweb. See http://www.swi-prolog.org/git.html for details on the central GIT repository and instructions for browsing the repository online.
Prolog files
rdf11.pl -- RDF 1.1 API![]() | ||
---|---|---|
rdf/3 | True if an RDF triple <S,P,O> exists, optionally in the graph G. | ![]() |
rdf/4 | True if an RDF triple <S,P,O> exists, optionally in the graph G. | ![]() |
rdf_assert/3 | Assert a new triple. | ![]() |
rdf_assert/4 | Assert a new triple. | ![]() |
rdf_assert_list/2 | Create an RDF list from the given Prolog List. | ![]() |
rdf_assert_list/3 | Create an RDF list from the given Prolog List. | ![]() |
rdf_bnode/1 | True if BNode is a currently known blank node. | ![]() |
rdf_canonical_literal/2 | Transform a relaxed literal specification as allowed for rdf_assert/3 into its canonical form. | ![]() |
rdf_compare/3 | True if the RDF terms Left and Right are ordered according to the comparison operator Diff. | ![]() |
rdf_create_bnode/1 | Create a new BNode. | ![]() |
rdf_default_graph/1 | Query/set the notion of the default graph. | ![]() |
rdf_default_graph/2 | Query/set the notion of the default graph. | ![]() |
rdf_estimate_complexity/4 | ![]() | |
rdf_has/3 | Similar to rdf/3 and rdf/4, but P matches all predicates that are defined as an rdfs:subPropertyOf of P. | ![]() |
rdf_has/4 | Similar to rdf/3 and rdf/4, but P matches all predicates that are defined as an rdfs:subPropertyOf of P. | ![]() |
rdf_iri/1 | True if IRI is a current IRI. | ![]() |
rdf_is_bnode/1 | True if Term is an RDF blank node identifier. | ![]() |
rdf_is_iri/1 | True if IRI is an RDF IRI term. | ![]() |
rdf_is_literal/1 | True if Term is an RDF literal term. | ![]() |
rdf_is_name/1 | True if Term is an RDF Name, i.e., an IRI or literal. | ![]() |
rdf_is_object/1 | True if Term can appear in the object position of a triple. | ![]() |
rdf_is_predicate/1 | True if Term can appear in the predicate position of a triple. | ![]() |
rdf_is_subject/1 | True if Term can appear in the subject position of a triple. | ![]() |
rdf_is_term/1 | True if Term can be used as an RDF term, i.e., if Term is either an IRI, a blank node or an RDF literal. | ![]() |
rdf_last/2 | True when Last is the last element of RDFList. | ![]() |
rdf_length/2 | True when Length is the number of cells in RDFList. | ![]() |
rdf_lexical_form/2 | True when Lexical is the lexical form for the literal Literal. | ![]() |
rdf_list/1 | True if RDFTerm is a proper RDF list. | ![]() |
rdf_list/2 | True when PrologList represents the rdf:first objects for all cells in RDFList. | ![]() |
rdf_literal/1 | True if Term is a known literal. | ![]() |
rdf_member/2 | True when Member is a member of RDFList. | ![]() |
rdf_name/1 | True if Name is a current IRI or literal. | ![]() |
rdf_nextto/2 | True if Y directly follows X in RdfList. | ![]() |
rdf_nextto/3 | True if Y directly follows X in RdfList. | ![]() |
rdf_node/1 | True when T appears in the subject or object position of a known triple, i.e., is a node in the RDF graph. | ![]() |
rdf_nth0/3 | True when X is the Index-th element (0-based or 1-based) of RDFList. | ![]() |
rdf_nth1/3 | True when X is the Index-th element (0-based or 1-based) of RDFList. | ![]() |
rdf_object/1 | True when O is a currently known object, i.e. | ![]() |
rdf_predicate/1 | True when P is a currently known predicate, i.e. | ![]() |
rdf_reachable/3 | True when O can be reached from S using the transitive closure of P. | ![]() |
rdf_reachable/5 | True when O can be reached from S using the transitive closure of P. | ![]() |
rdf_retract_list/1 | Retract the rdf:first, rdf:rest and rdf:type=rdf:'List' triples from all nodes reachable through rdf:rest. | ![]() |
rdf_retractall/3 | Remove all matching triples from the database. | ![]() |
rdf_retractall/4 | Remove all matching triples from the database. | ![]() |
rdf_subject/1 | True when S is a currently known subject, i.e. | ![]() |
rdf_term/1 | True if Term appears in the RDF database. | ![]() |
rdf_update/4 | Replaces one of the three fields on the matching triples depending on Action:. | ![]() |
rdf_update/5 | Replaces one of the three fields on the matching triples depending on Action:. | ![]() |
rdf_where/1 | Formulate constraints on RDF terms, notably literals. | ![]() |
{}/1 | Formulate constraints on RDF terms, notably literals. | ![]() |
rdf_cache.pl -- Cache RDF triples![]() | ||
rdf_db.pl -- Core RDF database![]() | ||
rdf_http_plugin.pl -- RDF HTTP Plugin![]() | ||
rdf_open_hook/8 | Load hook implementation for HTTP(S) URLs. | ![]() |
rdf_content_type/3 | Quality values are intended to be used in accordance with RFC 2616. | ![]() |
rdf_library.pl -- RDF Library Manager![]() | ||
rdf_litindex.pl -- Search literals![]() | ||
rdf_delete_literal_index/1 | Fully delete a literal index. | ![]() |
rdf_find_literal/2 | Find literals in the RDF database matching Spec. | ![]() |
rdf_find_literals/2 | Find literals in the RDF database matching Spec. | ![]() |
rdf_literal_index/2 | True when Index is a literal map containing the index of Type. | ![]() |
rdf_set_literal_index_option/1 | Set options for the literal package. | ![]() |
rdf_stopgap_token/1 | True when Token is a stopgap token. | ![]() |
rdf_token_expansions/2 | Determine which extensions of a token contribute to finding literals. | ![]() |
rdf_tokenize_literal/2 | Tokenize a literal. | ![]() |
rdf_ntriples.pl -- Process files in the RDF N-Triples format![]() | ||
rdf_persistency.pl -- RDF persistency plugin![]() | ||
rdf_portray.pl -- Portray RDF resources![]() | ||
rdf_sandbox.pl -- Declare RDF API sandbox-safe![]() | ||
rdf_turtle_write.pl -- Turtle - Terse RDF Triple Language writer![]() | ||
rdf_zlib_plugin.pl -- RDF compressed-data plugin![]() | ||
rdfs.pl -- RDFS handling![]() | ||
rdfs_assert_list/2 | Create an RDF list from the given Resources. | ![]() |
rdfs_assert_list/3 | Create an RDF list from the given Resources. | ![]() |
rdfs_class_property/2 | Enumerate the properties in the domain of Class. | ![]() |
rdfs_find/5 | Search all classes below Domain for a literal property with that matches String. | ![]() |
rdfs_individual_of/2 | Generate resources belonging to a class or classes a resource belongs to. | ![]() |
rdfs_label/2 | Convert between class and label. | ![]() |
rdfs_label/3 | Resource has Label in Lang. | ![]() |
rdfs_list_to_prolog_list/2 | Convert ann RDFS list (result from parseType=Collection) into a Prolog list of elements. | ![]() |
rdfs_member/2 | As Prolog member on sets. | ![]() |
rdfs_ns_label/2 | Present label with namespace indication. | ![]() |
rdfs_ns_label/3 | Present label with namespace indication. | ![]() |
rdfs_subclass_of/2 | Generate sub/super classes. | ![]() |
rdfs_subproperty_of/2 | Query the property hierarchy. | ![]() |
sparql_client.pl -- SPARQL client library![]() | ||
sparql_query/3 | Execute a SPARQL query on an HTTP SPARQL endpoint. | ![]() |
sparql_read_json_result/2 | The returned Result term is of the format:. | ![]() |
sparql_read_xml_result/2 | Specs from http://www.w3.org/TR/rdf-sparql-XMLres/. | ![]() |
sparql_set_server/1 | Set sparql server default options. | ![]() |
turtle.pl -- Turtle: Terse RDF Triple Language![]() |