@faubulous/mentor-rdf
    Preparing search index...

    Class ResourceRepository

    A repository for retrieving resources from graphs.

    Index

    Constructors

    Properties

    store: Store

    The RDF triple store.

    Methods

    • Get the language tags used in the object of triples with a given set of predicates.

      Parameters

      • graphUris: string | string[] | undefined

        URIs of the graphs to search.

      Returns LanguageTagUsageStats

      An array of language tag statistics, sorted by the number of occurrences in descending order.

    • Get the most frequently used language tag in the object of triples with a given set of predicates.

      Parameters

      • graphUris: string | string[] | undefined

        URIs of the graphs to search.

      Returns string | undefined

    • Get information about the usage of predicates in the document such as the frequency of use and the use of language tags.

      Parameters

      • graphUris: string | string[] | undefined

        URIs of the graphs to search.

      • predicateUris: string[] | undefined = undefined

        URIs of the predicates to match.

      Returns PredicateUsageStats

    • Indicate if a given URI exists as the subject of a triple in the graph.

      Parameters

      • graphUris: string | string[] | undefined

        URIs of the graphs to search.

      • subjectUri:
            | string
            | BlankNode
            | Literal
            | Variable
            | Quad
            | NamedNode<string>
            | NamedNode<string>

        URI of the subject to search for.

      Returns boolean

      true if the URI is a subject, false otherwise.

    • Indicate if a resource has a given type in the graph.

      Parameters

      • graphUris: string | string[] | undefined

        URIs of the graphs to search.

      • subjectUri: string

        URI or blank node id of the subject to match.

      • typeUri: string

        URI of the type to match.

      • Optionaloptions: QueryOptions

        Optional query parameters.

      Returns boolean

      true if the resource has the type, false otherwise.

    • Indicate if a node is explicitly defined by the given URI using the rdfs:isDefinedBy property, or implicitly by sharing the same namespace.

      Parameters

      • graphUris: string | string[] | undefined

        URIs of the graphs to search.

      • node: Quad_Subject

        A named node to check if it is defined by the given URI.

      • definedBy: string | null

        URI of the vocabulary that defines the resource (rdfs:isDefinedBy). Provide null to only return resources that have no rdfs:isDefinedBy property.

      Returns boolean

      true if the node is defined by the given URI, false otherwise.