rdf_triple.pl -- Create triples from intermediate representation
Convert the output of xml_to_rdf/3 from library(rdf) into a list of triples of the format described below. The intermediate representation should be regarded a proprietary representation.
rdf(Subject, Predicate, Object).
Where `Subject' is
- Atom
- The subject is a resource
- each(URI)
- URI is the URI of an RDF Bag
- prefix(Pattern)
- Pattern is the prefix of a fully qualified Subject URI
And `Predicate' is
- Atom
- The predicate is always a resource
And `Object' is
- Atom
- URI of Object resource
- literal(Value)
- Literal value (Either a single atom or parsed XML data)
- rdf_triples(+Term, -Triples) is det
- rdf_triples(+Term, -Tridpples, +Tail) is det
- Convert an object as parsed by rdf.pl into a list of rdf/3
triples. The identifier of the main object created is returned
by rdf_triples/3.
Input is the `content' of the RDF element in the format as generated by
load_structure(File, Term, [dialect(xmlns)])
. rdf_triples/3 can process both individual descriptions as well as the entire content-list of an RDF element. The first mode is suitable when using library(sgml) in `call-back' mode. - triples(-Triples, -Id, +In, -Tail)[private]
- DGC set processing the output of xml_to_rdf/3. Id is unified to the identifier of the main description.
- property(Property, N, NN, Subject)// is det[private]
- Generate triples for {Subject, Pred, Object}. Also generates triples for Object if necessary.
- statement(+Subject, +Pred, +Object, +Id, +BagH, -BagT)[private]
- Add a statement to the model. If
nonvar(Id)
, we reinify the statement using the given Id. - li_pred(+Pred, -Pred, +Nth, -NextNth)[private]
- Transform rdf:li predicates into _1, _2, etc.
- collection(+Elems, -Id)[private]
- Handle the elements of a collection and return the identifier for the whole collection in Id.
- rdf_start_file(+Options, -Cleanup) is det
- Initialise for the translation of a file.
- rdf_end_file(:Cleanup) is det
- Cleanup reaching the end of an RDF file.
- anon_prefix(-Prefix) is semidet
- If defined, it is the prefix used to generate a blank node.
- rdf_reset_ids is det
- Utility predicate to reset the gensym counters for the various
generated identifiers. This simplifies debugging and matching
output with the stored desired output (see
rdf_test.pl
).
Re-exported predicates
The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.
- rdf_triples(+Term, -Triples) is det
- rdf_triples(+Term, -Tridpples, +Tail) is det
- Convert an object as parsed by rdf.pl into a list of rdf/3
triples. The identifier of the main object created is returned
by rdf_triples/3.
Input is the `content' of the RDF element in the format as generated by
load_structure(File, Term, [dialect(xmlns)])
. rdf_triples/3 can process both individual descriptions as well as the entire content-list of an RDF element. The first mode is suitable when using library(sgml) in `call-back' mode.