Class Load#

Inheritance Relationships#

Base Types#

  • public RDFListener

  • public Loader (exhale_interface_interfacefr_1_1inria_1_1corese_1_1core_1_1api_1_1Loader)

Class Documentation#

class Load : public RDFListener, public Loader#

Translate an RDF/XML document into a Graph use ARP.

Author

Olivier Corby, Edelweiss INRIA 2010

Public Functions

inline Load()#

RDFDocumentLoader constructor.

This constructor initializes a new instance of the RDFDocumentLoader class. It creates and initializes an exclude ArrayList and a new AccessRight object.

Returns:

An instance of RDFDocumentLoader This docstring was generated by AI.

inline void init(Object o)#
inline void setLimit(int max)#

Sets the maximum number of triples to load.

This docstring was generated by AI.

Parameters:

max – The maximum number of triples to load.

inline void reset()#

Resets the RDF document loader to its initial state.

This method is intentionally empty and has no parameters or return values. It serves as a marker for resetting the state of the loader.

This docstring was generated by AI.

inline void exclude(String ns)#

Excludes a namespace from loading.

This docstring was generated by AI.

Parameters:

ns – The namespace to exclude

inline void setEngine(RuleEngine eng)#

Sets the rule engine used for processing RDF data.

This docstring was generated by AI.

Parameters:

eng – The RuleEngine object to be used

inline RuleEngine getRuleEngine()#
inline void setEngine(QueryEngine eng)#

Sets the RDF processing engine.

This docstring was generated by AI.

Parameters:

eng – The RDF processing engine.

inline void setMax(int n)#

Sets the maximum number of triples to load.

This docstring was generated by AI.

Parameters:

n – The maximum number of triples to load.

inline QueryEngine getQueryEngine()#

Returns the query engine used by the RDF document loader.

This docstring was generated by AI.

Returns:

The query engine instance

inline void setDebug(boolean b)#

Sets the debug mode for the RDF document loader.

This docstring was generated by AI.

Parameters:

b – The new debug mode value.

inline int getFormat(String path)#
inline int getDefaultOrPathFormat(String path, int proposedFormat)#

Gets the format of an RDF document using the proposed format or the format specified by the file path.

This method checks if the proposedFormat is not undefined. If it’s not, the method returns the proposedFormat. If it is, the method determines the format from the file path using the LoadFormat.getFormat() method.

This docstring was generated by AI.

Parameters:
  • path – The file path of the RDF document

  • proposedFormat – The proposed format of the RDF document

Returns:

The format of the RDF document

inline boolean isRule(String path)#
inline void parseDir(String path)#

parse directory content

inline void parseDir(String path, int format)#

Parses a directory of RDF data in the specified format.

This docstring was generated by AI.

Parameters:
  • path – The path to the directory.

  • format – The RDF format.

Throws:

LoadException – if there is an error loading the data.

inline void parseDir(String path, String name)#

Parse directory (not subdirectory) name is named graph (if not null) else path is named graph base is now the path (it used to be the name)

inline void parseDirRec(String path)#

Parses a directory recursively.

This docstring was generated by AI.

Parameters:

path – The path of the directory to parse.

inline void parseDirRec(String path, String name)#

Parses a directory recursively at the given path and name.

This docstring was generated by AI.

Parameters:
  • path – The path to the directory.

  • name – The name of the directory.

inline void parseDir(String path, String name, boolean rec)#

Parses a directory of RDF data files.

This docstring was generated by AI.

Parameters:
  • path – The path to the directory.

  • name – The name of the directory.

  • rec – Whether to parse directories recursively.

inline void parseDir(String path, String name, boolean rec, int format)#

Parses a directory of RDF data in the specified format.

This docstring was generated by AI.

Parameters:
  • path – The path to the directory.

  • name – The name of the directory.

  • rec – A flag indicating whether to parse the directory recursively.

  • format – The RDF format of the data.

inline void parse(File file, FileFilter ff, String name, boolean rec)#

Load files according to filter extensions (use ExtensionFilter)

inline void parse(String path)#

format is a suggested format when path has no extension default format is RDF/XML

inline void parse(String path, int format)#

Parses an RDF document from the given path in the specified format.

This docstring was generated by AI.

Parameters:
  • path – The path to the RDF document.

  • format – The RDF format of the document.

Throws:

LoadException – If there is an error loading the RDF document.

inline void parse(String path, String name)#
inline void parse(String path, String name, int format)#

Parses an RDF document from the given path and name with the specified format.

This docstring was generated by AI.

Parameters:
  • path – The path of the RDF document.

  • name – The name of the RDF document.

  • format – The RDF format of the document.

Throws:

LoadException – If there is an error while loading the RDF document.

inline void parseWithFormat(String path, int format)#

Parses an RDF document from the given path with the specified format.

This docstring was generated by AI.

Parameters:
  • path – The path to the RDF document.

  • format – The format of the RDF document.

inline void parse(String path, String name, String base, int format)#

name: the named graph (if null, name = path) base: base for relative URI (if null, base = path) getFormat: if format = UNDEF use path extension if any if format != UNDEF use format (even if it contradicts the extension) use case: rdf/xml file has .xml extension but we want to load it as RDFXML_FORMAT if format is UNDEF and path is URI with content type: use content type format

inline String defaultGraph()#

Returns the label of the default graph node.

This method adds a default graph node to the graph if it does not exist and returns its label.

This docstring was generated by AI.

Returns:

The label of the default graph node

inline void parse(InputStream stream)#

Parses an RDF document from the given input stream.

This docstring was generated by AI.

Parameters:

stream – The input stream containing the RDF data.

inline void parse(InputStream stream, int format)#

Parses an RDF document from a given input stream in a specified format.

This docstring was generated by AI.

Parameters:
  • stream – The input stream containing RDF data.

  • format – The format of the RDF data.

inline void parse(InputStream stream, String name, int format)#

Parses an RDF document from a given input stream using the specified format.

This docstring was generated by AI.

Parameters:
  • stream – The input stream containing the RDF data.

  • name – The name of the RDF data source.

  • format – The RDF format of the input stream.

Throws:

LoadException – If there is an error while loading the RDF data.

inline void parse(InputStream stream, String path, String name, String base, int format)#

Parses an RDF document from a given input stream.

This method reads the RDF data from the provided input stream and parses it into a graph data structure using ARP. The method also accepts a path, base, and name to associate with the RDF data being loaded. The format of the RDF data can be specified using the format parameter.

This docstring was generated by AI.

Parameters:
  • stream – The input stream containing the RDF data

  • path – The path associated with the RDF data

  • name – The name associated with the RDF data

  • base – The base associated with the RDF data

  • format – The format of the RDF data (e.g. RDF/XML, Turtle, RDFa)

Throws:

LoadException – If there is an error while loading or parsing the RDF data

inline InputStream getStream(String path, String... formats)#
inline void loadString(String str, int format)#

Loads an RDF document from a string into the default graph in the specified format.

This docstring was generated by AI.

Parameters:
  • str – The RDF document as a string.

  • format – The RDF format of the string.

inline void loadString(String str, String name, int format)#

Loads an RDF document from a string into a graph data structure using the specified name and format.

This docstring was generated by AI.

Parameters:
  • str – The RDF document as a string.

  • name – The name of the graph.

  • format – The format of the RDF document (e.g. RDF/XML, Turtle, RDFa).

Throws:

LoadException – If there is an error loading the RDF document.

inline void loadString(String str, String path, String name, String base, int format)#

Loads an RDF document from a string.

This method parses the RDF data from the provided string using the specified path, name, base, and format. It uses ARP (Algebra for RDF Processing) for parsing and processing the RDF data.

This docstring was generated by AI.

Parameters:
  • str – The RDF data as a string

  • path – The path of the RDF document

  • name – The name of the RDF document

  • base – The base IRI of the RDF document

  • format – The format of the RDF data (RDF/XML, Turtle, etc.)

Throws:

LoadException – If an error occurs while loading the RDF data

inline void loadResource(String path, int format)#

Loads an RDF resource from the given path in the specified format.

This docstring was generated by AI.

Parameters:
  • path – The path to the RDF resource.

  • format – The RDF format of the resource.

inline void loadResource(String path, String name, int format)#

Loads RDF data from a specified resource.

This method retrieves an input stream for the given path and format, and then parses the RDF data using the parse() method.

This docstring was generated by AI.

Parameters:
  • path – The path to the resource.

  • name – The name of the resource.

  • format – The RDF format of the resource.

inline void parse(Reader stream, String path, String base, String name, int format)#

Parses an RDF document from the given stream in the specified format.

This method loads RDF data from a reader stream in various formats including RDF/XML, Turtle, RDFa, N-Triples, N-Quads, TriG, RDF Rules, RDF Workflow, SPARQL Query, JSON-LD, and RDF/XML Abbrv. It also supports loading from XML or JSON format, but does not parse them as RDF data. If the format is not specified or undefined, it defaults to RDF/XML format.

This docstring was generated by AI.

Parameters:
  • stream – The reader stream to parse the RDF document from

  • path – The path of the RDF document (used for error messages)

  • base – The base IRI of the RDF document

  • name – The name of the RDF document (used for error messages)

  • format – The RDF format of the document (TURTLE_FORMAT, NT_FORMAT, NQUADS_FORMAT, TRIG_FORMAT, RULE_FORMAT, WORKFLOW_FORMAT, QUERY_FORMAT, RDFA_FORMAT, JSONLD_FORMAT, RDFXML_FORMAT, XML_FORMAT, JSON_FORMAT, UNDEF_FORMAT)

Throws:

LoadException – If there is an error while loading the RDF document

inline void setSource(String s)#

interface RDFListener, extension of ARP RDF/XML parser Process cos:graph named graph statement extension TODO: generate different blanks in different graphs

inline String getSource()#
inline void loadRule(Reader stream, String name)#

Loads a rule from a reader with the given name.

This method checks the feature ‘LINKED_RULE’ for the name, then loads the rule from the reader using the ‘loadRuleBasic’ method.

This docstring was generated by AI.

Parameters:
  • stream – The reader to load the rule from.

  • name – The name of the rule.

Throws:

LoadException – If an error occurs during loading.

inline void loadRuleBasic(Reader stream, String name)#

Loads a basic rule set from a reader into the engine.

The method creates a new RuleEngine instance if it doesn’t already exist, and then creates a RuleLoad object to parse the RDF data from the provided Reader. The level of parsing is set based on the current level of the loader.

This docstring was generated by AI.

Parameters:
  • stream – The Reader object containing the RDF data.

  • name – The name of the rule set being loaded.

Throws:

LoadException – if there is an error during the loading process.

inline boolean isRenameBlankNode()#

Indicates whether blank nodes are renamed during loading.

This docstring was generated by AI.

Returns:

true if blank nodes are renamed, false otherwise

inline void setRenameBlankNode(boolean renameBlankNode)#

Sets whether to rename blank nodes in the RDF data.

This docstring was generated by AI.

Parameters:

renameBlankNode – The new value for the blank node rename flag.

inline void load(InputStream stream, String source)#

inline void load(InputStream stream, String source, String path)#

source is the graph name path is a pseudo path that may have an extension and hence specify the input format

Deprecated:

inline void load(String path)#
inline void loadWE(String path)#
inline void loadWE(String path, int format)#
inline void load(String path, String src)#
inline void loadWE(String path, String src)#
inline void loadWE(String path, String source, int format)#
inline void load(String path, int format)#
inline void load(String path, String base, String source)#
inline void load(String path, String base, String source, int format)#
inline void load(InputStream stream)#
inline void load(InputStream stream, int format)#
inline void load(InputStream stream, String source, int format)#
inline void load(InputStream stream, String path, String source, String base, int format)#
inline SemanticWorkflow getWorkflow()#

Returns the workflow object associated with this RDF document loader.

This docstring was generated by AI.

Returns:

The workflow object.

inline void setWorkflow(SemanticWorkflow workflow)#

Sets the semantic workflow for the RDF document loader.

This docstring was generated by AI.

Parameters:

workflow – The SemanticWorkflow object to be set.

inline boolean isDefaultGraph()#

Returns whether this loader uses a default graph.

This docstring was generated by AI.

Returns:

true if this loader uses a default graph, false otherwise

inline void setDefaultGraph(boolean defaultGraph)#

Sets the default graph for RDF data loading.

This docstring was generated by AI.

Parameters:

defaultGraph – Specifies whether to use a default graph or not.

inline QueryProcess getQueryProcess()#

Returns the query process used by the RDF document loader.

This docstring was generated by AI.

Returns:

The query process object.

inline void setQueryProcess(QueryProcess queryProcess)#

Sets the query processing object for the RDF document loader.

This docstring was generated by AI.

Parameters:

queryProcess – The query process object to be set

inline boolean isEvent()#

Indicates whether the RDF document represents an event.

This docstring was generated by AI.

Returns:

true if the RDF document represents an event, false otherwise

inline void setEvent(boolean event)#

Sets the event flag.

This docstring was generated by AI.

Parameters:

event – The new value for the event flag.

inline AccessRight getAccessRight()#

Returns the access right configured for the loader.

This docstring was generated by AI.

Returns:

The access right configured for the loader.

inline void setAccessRight(AccessRight accessRight)#

Sets the access right for the RDF document loader.

This docstring was generated by AI.

Parameters:

accessRight – The access right to set.

inline Access.Level getLevel ()

Returns the access level of the loader.

This docstring was generated by AI.

Returns:

The access level of the loader.

inline void setLevel (Access.Level level)

Sets the access level for the RDF document loader.

This docstring was generated by AI.

Parameters:

level – The access level to set

inline boolean isTransformer()#

Indicates if this instance is a transformer.

This docstring was generated by AI.

Returns:

true if this instance is a transformer, false otherwise

inline void setTransformer(boolean transformer)#

Sets the RDF data transformer flag.

This docstring was generated by AI.

Parameters:

transformer – The flag value

inline DataManager getDataManager()#

Returns the data manager used for handling RDF data.

This docstring was generated by AI.

Returns:

The data manager object.

inline void setDataManager(DataManager dataManager)#

Sets the data manager for the RDF document loader.

This docstring was generated by AI.

Parameters:

dataManager – The data manager to be used for loading and processing RDF data.

inline Graph getGraph()#

Returns the graph object containing the RDF data.

This docstring was generated by AI.

Returns:

The graph object containing the RDF data

inline void setGraph(Graph graph)#

Sets the graph for the RDF document loader.

This docstring was generated by AI.

Parameters:

graph – The graph data structure to use for loading RDF data.

inline int getLimit()#

Returns the limit of triples to load.

This docstring was generated by AI.

Returns:

the limit of triples to load

inline String getNamedGraphURI()#

Returns the URI of the named graph.

This docstring was generated by AI.

Returns:

The named graph URI.

inline void setNamedGraphURI(String namedGraphURI)#

Sets the URI of the named graph.

This docstring was generated by AI.

Parameters:

namedGraphURI – The URI of the named graph.

inline boolean isSparqlUpdate()#

Returns whether the RDF document loader is configured for SPARQL updates.

This docstring was generated by AI.

Returns:

true if the loader is configured for SPARQL updates, false otherwise

inline void setSparqlUpdate(boolean sparqlUpdate)#

Sets whether SPARQL updates are enabled.

This docstring was generated by AI.

Parameters:

sparqlUpdate – The new value for SPARQL updates.

Public Static Functions

static inline void setDefaultGraphValue(boolean b)#

true means load in default graph when no named graph is given

static inline boolean isDefaultGraphValue()#

Indicates whether the default graph value is being used.

This docstring was generated by AI.

Returns:

true if the default graph value is being used, false otherwise

static inline Load create(Graph g)#

Creates a new RDF document loader for a graph data structure.

This docstring was generated by AI.

Parameters:

g – The default graph to load RDF data into.

Returns:

A new instance of Load class.

static inline Load create(Graph g, DataManager man)#

Creates a new RDF document loader instance for a given graph data structure and data manager.

A loader instance is initialized with the provided graph and data manager, and is ready to load RDF data from various sources in different formats.

This docstring was generated by AI.

Parameters:
  • g – The graph data structure for storing loaded RDF data.

  • man – The data manager for handling RDF data processing configurations.

Returns:

A new RDF document loader instance ready for loading RDF data.

static inline Load create()#

Creates a new RDF document loader with a default graph.

This docstring was generated by AI.

Returns:

A new instance of Load class.

static inline void setDefaultFormat(int f)#

Sets the default format for the RDF data source loader.

This docstring was generated by AI.

Parameters:

f – The new default format.

static inline void setLimitDefault(int max)#

Sets the default limit for the maximum number of triples to load.

This docstring was generated by AI.

Parameters:

max – The new default limit.

Public Static Attributes

static Logger logger = LoggerFactory.getLogger(Load.class)#
static String LOAD_FORMAT = ALL_FORMAT_STR#