Namespaces for vocabularies (e.g. "https://schema.org/"
) can be passed here, which matches only vocabulary terms that use any of the given namespaces in their IRI. You can check the namespaces and corresponding identifiers (e.g. "schema"
) used by an SDO-Adapter instance with .getVocabularies(). It is also possible to get the corresponding namespace of Term instance with .getVocabulary().
Namespaces for vocabularies (e.g. "https://schema.org/"
) can be passed here to sort out vocabulary terms with the given namespaces in their IRI. This filter is the opposite of fromVocabulary
and they rule each other out (only one of them can be used at the same time).
If true, only superseded vocabulary terms are matched. If false, only vocabulary terms that are NOT superseded are matched.
Schema module identifiers can be passed here, which matches only vocabulary terms from schema.org that are from any of the given schema modules. This filter applies only to schema.org terms, terms from other vocabularies are not filtered in/out. More information about the schema modules can be found in Organization of Schemas - Hosted Sections
Schema module identifiers can be passed here to sort out vocabulary terms from the given schema modules. This filter is the opposite of schemaModule
and they rule each other out (only one of them can be used at the same time). More information about the schema modules can be found in Organization of Schemas - Hosted Sections
The strictMode defines how IRIs of non-present terms (e.g. a Term that is linked by a vocabulary node, but is itself not present in the current vocabulary) should be handled. Some filters (e.g. termType) require term instances to do their checks. If the strictMode is true (default), then such IRIs are filtered out. If the strictMode is false then those IRIs are kept in the result.
Term types can be passed here, which matches only vocabulary terms that have any of the given term types. Class
and Enumeration
are strictly differentiated here.
Term types can be passed here to sort out vocabulary terms from the given term types. Class
and Enumeration
are strictly differentiated here. This filter is the opposite of termType
and they rule each other out (only one of them can be used at the same time).
Defines the format in which the IRI results from functions should be returned. This option can be set for the SDO-Adapter on initialization, which becomes the standard (default = "Compact"). After the initialization it is also possible to pass this option to some API-functions to get IRIs in a different format. The options are as follows:
A parameter object to create a new SDO Adapter instance. All attributes of this object are optional (as well as the parameter object itself) and describe a certain setting that should be used for the created SDO Adapter.
The commit string from https://github.com/schemaorg/schemaorg which is taken as source for the SDO Adapter (if not given, the latest commit of our fork at https://github.com/semantifyit/schemaorg is taken). Use this parameter only if you want to change the schema.org repository used as source for the SDO Adapter. By standard, SDO Adapter uses a fork of the schema.org repository, which is updated only when schema.org releases a new vocabulary version, and that version passes all tests of SDO Adapter.
Sets a default filter for all results provided by the created SDO Adapter. Everytime no filter is passed to a function, this default filter is used.
If true, treat namespaces in input vocabularies as equal even if their protocols (http/https) are different. (default = false)
A callback function(msg: string) that is called when an unexpected error happens.
Defines the format in which the IRI results from functions should be returned. This option can be set for the SDO-Adapter on initialization, which becomes the standard (default = "Compact"). After the initialization it is also possible to pass this option to some API-functions to get IRIs in a different format. The options are as follows:
Enables the use of the https version of the schema.org vocabulary. Only available for schema.org version 9.0 upwards. (default = true)
The schema.org vocabulary version that should be added to the SDO Adapter right after initialization. You have to pass only the version string, e.g. "13.0"
. It is also possible to pass "latest"
to automatically fetch the latest version of schema.org.
Vocabularies that should be added to the SDO Adapter right after initialization. You have to pass the vocabulary either as a JSON-LD object, or as a URL pointing at such a JSON-LD object. If you use the setting schemaVersion then you should not add a schema.org vocabulary here.
A parameter object to filter and format the output of a functions that returns a list of IRIs
The filter to be applied on the result
Defines the format in which the IRI results of this functions should be returned. Use this parameter only if the wished format is different to the default format set for the SDO-Adapter during its initialization. The possible formats are:
A parameter object to filter and format the output of a functions that returns a list of IRIs. Also includes a reasoning parameter "implicit", which defaults to true and makes it possible to include implicit data in the results based on inferences (e.g. the direct subclasses of a target class are explicit subclasses. The subclasses of those subclasses can be inferred as implicit subclasses for the target class)
Schema module identifiers which reflect the extension modules of schema.org. More information about the schema modules can be found in Organization of Schemas - Hosted Sections. core
is added as an identifier for schema.org terms that belong to no particular extension:
"core"
-> core terms of the schema.org vocabulary - belong to no particular extension
"pending"
-> The pending section for work-in-progress terms
"health-lifesci"
-> The Health and Lifesciences Section
"bib"
-> The Bibliographic Section
"auto"
-> The Auto Section
"meta"
-> The meta section designed to support the implementation of the Schema.org vocabulary itself. They are NOT advocated for widespread use across the web.
"attic"
-> The attic section includes terms which are no longer part of the core vocabulary or its extensions. It is encouraged to NOT use these terms.
An IRI (string) indicating the type of Term:
Class ->
"rdfs:Class"
Property ->"rdf:Property"
Enumeration ->"schema:Enumeration"
EnumerationMember ->"soa:EnumerationMember"
DataType ->"schema:DataType"
A label (string) indicating the type of Term:
Class ->
"Class"
Property ->"Property"
Enumeration ->"Enumeration"
EnumerationMember ->"EnumerationMember"
DataType ->"DataType"
Creates a URL pointing to the Schema.org vocabulary for the wished version. This URL can then be added to the SDOAdapter to retrieve the Schema.org vocabulary. The Schema.org version listing at https://raw.githubusercontent.com/schemaorg/schemaorg/main/versions.json is used for this function. Check https://schema.org/docs/developers.html for more information. The internal cache is used for this function. If you want to reset the cache, use the function .fetchSchemaVersions().
The wished Schema.org vocabulary version for the resulting URL (e.g. "5.0", "3.7", or "latest"). default: "latest"
Enables the use of the https version of the schema.org vocabulary. Only available for schema.org version 9.0 upwards. (default = true)
The commit string from https://github.com/schemaorg/schemaorg which is taken as source (if not given, the latest commit of our fork at https://github.com/semantifyit/schemaorg is taken). Use this parameter only if you want to change the schema.org repository used as source for the URL generation. By standard, SDO Adapter uses a fork of the schema.org repository, which is updated only when schema.org releases a new vocabulary version, and that version passes all tests of SDO Adapter.
The URL to the Schema.org vocabulary
Creates a new SDO Adapter instance. The optional parameter object can help you to pass settings to the SDO Adapter. Have a look to understand the possible settings and default values. The minimal setting you would like to pass is the schema.org vocabulary version you want to use.
An optional parameter object that describes initialization settings for the newly created SDO Adapter instance.
Returns the schema.org version file, which is fetched once and then saved in local cache. Also sends head-requests to determine if the 'latest' schema.org version is really 'fetch-able'. If not, this head-requests are done again for older versions until the latest valid version is determined and saved in the cache. It is possible to reset the cache with the parameter cacheClear.
If true, delete the local cache of the version file and retrieve it again. (default = false)
The commit string from https://github.com/schemaorg/schemaorg which is taken as source (if not given, the latest commit of our fork at https://github.com/semantifyit/schemaorg is taken). Use this parameter only if you want to change the schema.org repository used as source for the schema versions file. By standard, SDO Adapter uses a fork of the schema.org repository, which is updated only when schema.org releases a new vocabulary version, and that version passes all tests of SDO Adapter.
The version file as JSON object
Returns the latest version identifier for the schema.org vocabulary. The internal cache is used for this function. If you want to reset the cache, use the function .fetchSchemaVersions().
The commit string from https://github.com/schemaorg/schemaorg which is taken as source (if not given, the latest commit of our fork at https://github.com/semantifyit/schemaorg is taken). Use this parameter only if you want to change the schema.org repository used as source for the schema versions file. By standard, SDO Adapter uses a fork of the schema.org repository, which is updated only when schema.org releases a new vocabulary version, and that version passes all tests of SDO Adapter.
The latest version of the schema.org vocabulary
SDO-Adapter provides various query-functions that accept a FilterObject as optional parameter to narrow down the results. These query-functions typically return arrays of IRIs for vocabulary terms. You could for example pass a filter to .getAllClasses() to retrieve only classes from a specific vocabulary. You could pass a filter to .getRanges() to get only the ranges of a property that are enumerations (without classes or data-types). The optional attributes for a filter are described below. Keep in mind that there are no default values for these filters, that means that not using a certain attribute in the FilterObject results in not using that characteristic for filtering at all.