afs_skos_extract - AFS - Reference Guides

AFS Filters Description

Product
AFS
AFS_Version
7.11
Category
Reference Guides
language
English

The SKOS Extract filter allows the user to build facets using a SKOS thesaurus

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

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

The SKOS Extract 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

USER_1

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

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

separator

No

string

/

The separator used to separate hierarchical facets in the result.

uri_separator

No

string

-

The separator used to separate hierarchical uris in the result.

xpaths

Yes

list

N/A

Xpaths of the uris to solve in the thesaurus.

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

For instance: If the "input layer" received the following XML data:
         <root>
        <node>urn:test_afs_skos_extract#B</node>
        <node>urn:test_afs_skos_extract#D</node>
        </root>
        
And the SKOS thesaurus (turtle formalism) is as follows:
          @prefix p1: <urn:test_afs_skos_extract#> .

 p1:CptScheme rdf:type skos:ConceptScheme ;
              skos:hasTopConcept p1:Root .

 p1:Root rdf:type skos:Concept ;       
         skos:prefLabel "Root_en"@en ,
                        "Root_fr"@fr ;       
         skos:narrower p1:A ,
                       p1:C ;

 p1:A rdf:type skos:Concept ;
      skos:prefLabel "A_en"@en ,
                     "A_fr"@fr ;    
      skos:narrower p1:B ;

 p1:B rdf:type skos:Concept ;
      skos:prefLabel "B_en"@en ,
                     "B_fr"@fr ;
     
 p1:C rdf:type skos:Concept ;
      skos:prefLabel "C_en"@en ,
                     "C_fr"@fr ;    
      skos:narrower p1:D .

 p1:D rdf:type skos:Concept ;
      skos:prefLabel "D_en"@en ,
                     "D_fr"@fr ;
        
The filter will generate the following XML layer:
<?xml version="1.0"?>
<resolvedFacet>
  <uri value="urn:test_afs_rdf_skos_resolv#B">
    <value xml:lang="en">Root_en/A_en/B_en</value>
    <value xml:lang="fr">Root_fr/A_fr/B_fr</value>
    <solved_uri>urn:test_afs_skos_extract#Root-urn:test_afs_skos_extract#A-urn:test_afs_skos_extract#B</solved_uri>
  </uri>
  <uri value="urn:test_afs_rdf_skos_resolv#D">
    <value xml:lang="en">Root_en/C_en/D_en</value>
    <value xml:lang="fr">Root_fr/C_fr/D_fr</value>
    <solved_uri>urn:test_afs_skos_extract#Root-urn:test_afs_skos_extract#C-urn:test_afs_skos_extract#D</solved_uri>
  </uri>
</resolvedFacet>