library adds interpretation of the triple store in terms of concepts
from RDF-Schema (RDFS). There are two ways to provide support for more
high level languages in RDF. One is to view such languages as a set of entailment
rules. In this model the rdfs library would provide a predicate rdfs/3
providing the same functionality as rdf/3
on union of the raw graph and triples that can be derived by applying
the RDFS entailment rules.
Alternatively, RDFS provides a view on the RDF store in terms of
individuals, classes, properties, etc., and we can provide predicates
that query the database with this view in mind. This is the approach
taken in the
library(semweb/rdfs.p)l library, providing
SeRQL language is based on querying the deductive closure of the triple
set. The SWI-Prolog SeRQL library provides entailment modules
that take the approach outlined above.
The predicates in this section explore the
rdf:type relations. Note
that the most fundamental of these,
also used by rdf_has/[3,4].
- rdfs_subproperty_of(?SubProperty, ?Property)
- True if SubProperty is equal to Property or Property
can be reached from SubProperty following the
rdfs:subPropertyOfrelation. It can be used to test as well as generate sub-properties or super-properties. Note that the commonly used semantics of this predicate is wired into rdf_has/[3,4].bugThe current implementation cannot deal with cycles.bugThe current implementation cannot deal with predicates that are an
rdfs:subPropertyOf, such as
- rdfs_subclass_of(?SubClass, ?Class)
- True if SubClass is equal to Class or Class
can be reached from SubClass following the
rdfs:subClassOfrelation. It can be used to test as well as generate sub-classes or super-classes.bugThe current implementation cannot deal with cycles.
- rdfs_class_property(+Class, ?Property)
- True if the domain of Property includes Class. Used to generate all properties that apply to a class.
- rdfs_individual_of(?Resource, ?Class)
- True if Resource is an indivisual of Class. This
Resource has an
rdf:typeproperty that refers to Class or a sub-class thereof. Can be used to test, generate classes Resource belongs to or generate individuals described by Class.
constructs a list using the
- rdfs_member(?Resource, +Set)
- Test or generate the members of Set. Set is either
an individual of
- rdfs_list_to_prolog_list(+Set, -List)
- Convert Set, which must be an individual of
rdf:Listinto a Prolog list of objects.
- rdfs_assert_list(+List, -Resource)
- Equivalent to rdfs_assert_list/3
using DB =
- rdfs_assert_list(+List, -Resource, +DB)
- If List is a list of resources, create an RDF list Resource that reflects these resources. Resource and the sublist resources are generated with rdf_bnode/1. The new triples are associated with the database DB.