afs_sparql_construct - AFS - Reference Guides

AFS Filters Description

Product
AFS
Platform
7.11
Category
Reference Guides
Language
English

The afs_sparql_construct filter generates RDF triples from an initial set of triples (whether from an existing triplesore or RDF files).

The filter is declared with the afs_sparql_construct type. It is in the antidot-paf-rdf package. It is a generator filter.

This filter can be instantiated only once at any given moment. It will not read the "instances" parameter in the configuration.

The SPARQL Construct filter specifications are described in the following table:

Parameter name

Mandatory

Type

Default

Description

base_triplestores_path

No

directory

N/A

It is the path to a folder which contains several pre-duplicated triplestores.

triplestore_path

No

directory

N/A

It is the path to a unique triplestore (disk or SPARQL end-point url).

rdf_layer

No

layer

No RDF loaded from layer

It is where to read an RDF layer to load in the triplestore at runtime (i.e. in process).

rdf_layers

No

list

Empty List

It is where to read a set of RDF layers to load in the triplestore at runtime (i.e. in process).

nb_clear

No

integer

1

When the triplestore is contextual, it is how many process methods are made before reinitializing the triplestore.

triplestores_tempdir

No

directory

$AFS7/afs_triplestores

It is the temp path where a filter works on some triplestore in disk mode.

binding_map

No

map

N/A

It defines the binding map, where keys are SPARQL variables names, and values are XPaths.

binding_map_type

No

map

N/A

It allows to force the type of a binding variable. Key is the name of the binding variable, Value can be 'uri' or 'literal'.

binding_map_datatype

No

map

N/A

It allows to force the datatype of a binding variable if binding_map_type defines a binding variable as a literal. Key is the name of the binding variable, Value is a CURIE.

binding_map_lang

No

map

N/A

It allows to force the language of a binding variable if binding_map_type defines a binding variable as a literal. Key is the name of the binding variable, Value is an ISO 639-1 language code.

construct_directories

No

directory_list

N/A

It is where to find the SPARQL construct queries to execute (.rq).

input_layer

No

layer

CONTENTS

It is where to read the input XML document where XPaths are applied.

nsmap

No

map

Empty Map

Namespaces to interpret XPaths

output_layer

No

layer

CONTENTS

It is where to write the result

rdf_directories

No

directory_list

Empty List

A list of directories containing rdf files (.owl, .rdf, .xml) to load in a triplestore

rdf_files

No

file_list

Empty List

A list of rdf files to load in a triplestore

use_rdfs_inference

No

boolean

false

When set to 'true', apply automatically RDFs inferences.

use_mondeca_engine

No

boolean

false

Activate if the project contains Mondeca thesaurus with SPARQL inference encapsulated

force_rdf_format

No

string

auto-detected

Force input RDF format to avoid spending time in auto detection. Available values are: - RDF_XML, - TURTLE, - N_TRIPLES, - N3

filter_directories

Yes

list

N/A

List of files containing queries to apply. Files must have .rq extension. Queries are applied in alphabetic order.

output_format

No

string

RDF_XML

The output format. Can be: N3, RDF_XML, TURTLE or N_TRIPLES.

update_triplestore

No

boolean

false

Instead of saving the SPARQL graph result into a layer, update the triplestore with these triples. The new triples will be saved in a named graph called by the document uri. Any triples in the same named graph which pre-exists in the triplestore will be dropped. Be careful the filter configuration MUST use a persistant triplestore. Otherwise, all modification are made in a temporary triplestore which is dropped at the end of the filter. Currently, the only configuration which loads a persistant triplestore is with "base_triplestores_path" and no "rdf_layer(s)" parameter.

This filter is used to execute SPARQL Construct queries in order to "construct" new triples. It differs from SPARQL Select queries used by afs_sparql_select filter, which navigates through a triplestore and selects desired triples.
Note: For more information about SPARQL queries, see WRC Website - SPARQL Queries (http://www.w3.org/TR/sparql11-query/#construct).