Skip to main content

LDParser.getPrefixes() method

GetPrefixesreturns a map of potential RDF prefixes based on the JSON-LD Term Definitions in this context. No guarantees of the prefixes are given, beyond that it will not contain ":".

onlyCommonPrefixes: If true, the result will not include "not so useful" prefixes, such as "term1": "http://example.com/term1", e.g. all IRIs will end with "/" or "#". If false, all potential prefixes are returned.

Signature:

static getPrefixes(context: string | JSON, onlyCommonPrefixes: boolean, properties?: Array<string>): Promise<Map<string, string>>;

Parameters

ParameterTypeDescription
contextstring | JSONJSONLD context
onlyCommonPrefixesbooleanonly common prefixes
propertiesArray<string>(Optional) available properties in type definition

Returns:

Promise<Map<string, string>>

Promise<<Map<string, string>>