SWI-Prolog Semantic Web Library 3.0
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog Semantic Web Library 3.0
        • Introduction
        • Scalability
        • Two RDF APIs
        • Plugin modules for rdf_db
        • library(semweb/turtle): Turtle: Terse RDF Triple Language
        • library(semweb/rdf_ntriples): Process files in the RDF N-Triples format
        • library(semweb/rdfa): Extract RDF from an HTML or XML DOM
          • read_rdfa/3
          • xml_rdfa/3
          • rdf_db:rdf_load_stream/3
        • library(semweb/rdfs): RDFS related queries
        • Managing RDF input files
        • library(semweb/sparql_client): SPARQL client library
        • library(semweb/rdf_compare): Compare RDF graphs
        • library(semweb/rdf_portray): Portray RDF resources
        • Related packages
        • Version 3 release notes

7 library(semweb/rdfa): Extract RDF from an HTML or XML DOM

See also
- http://www.w3.org/TR/2013/REC-rdfa-core-20130822/
- http://www.w3.org/TR/html-rdfa/

This module implements extraction of RDFa triples from parsed XML or HTML documents. It has two interfaces: read_rdfa/3 to read triples from some input (stream, file, URL) and xml_rdfa/3 to extract triples from an HTML or XML document that is already parsed with load_html/3 or load_xml/3.

[det]read_rdfa(+Input, -Triples, +Options)
True when Triples is a list of rdf(S,P,O) triples extracted from Input. Input is either a stream, a file name, a URL referencing a file name or a URL that is valid for http_open/3. Options are passed to open/4, http_open/3 and xml_rdfa/3. If no base is provided in Options, a base is deduced from Input.
xml_rdfa(+DOM, -RDF, +Options)
True when RDF is a list of rdf(S,P,O) terms extracted from DOM according to the RDFa specification. Options processed:
base(+BaseURI)
URI to use for” . Normally set to the document URI.
anon_prefix(+AnnonPrefix)
Prefix for blank nodes.
lang(+Lang)
Default for lang
vocab(+Vocab)
Default for vocab
markup(+Markup)
Markup language processed (xhtml, xml, ...)
[multifile]rdf_db:rdf_load_stream(+Format, +Stream, :Options)
Register library(semweb/rdfa) as loader for HTML RDFa files.
To be done
Which options need to be forwarded to read_rdfa/3?