Options
All
  • Public
  • Public/Protected
  • All
Menu

rdflib

Index

References

Renames and re-exports Store
Renames and re-exports __type
Renames and re-exports sym

Properties

jsonParser: { parseJSON: (data: any, source: any, store: any) => void }

Type declaration

  • parseJSON: (data: any, source: any, store: any) => void
      • (data: any, source: any, store: any): void
      • Parameters

        • data: any
        • source: any
        • store: any

        Returns void

Variables

DataFactory: IRDFlibDataFactory = ...

Full RDFLib.js Data Factory

NextId: number = BlankNode.nextId
log: { debug: any; error: any; info: any; msg: any; success: any; warn: any } = ...

Type declaration

  • debug:function
    • debug(x: any): void
  • error:function
    • error(x: any): void
  • info:function
    • info(x: any): void
  • msg:function
    • msg(x: any): void
  • success:function
    • success(x: any): void
  • warn:function
    • warn(x: any): void

Functions

  • N3Parser(store: any, openFormula: any, thisDoc: any, baseURI: any, genPrefix: any, metaURI: any, flags: any, why: any): SinkParser
  • Parameters

    • store: any
    • openFormula: any
    • thisDoc: any
    • baseURI: any
    • genPrefix: any
    • metaURI: any
    • flags: any
    • why: any

    Returns SinkParser

  • SPARQLToQuery(SPARQL: any, testMode: any, kb: any): false | Query
  • sparql:

    SPARQL text that is converted to a query object which is returned.

    testmode:

    testing flag. Prevents loading of sources.

    Parameters

    • SPARQL: any
    • testMode: any
    • kb: any

    Returns false | Query

  • Serializer(store: any): Serializer
  • defaultGraph(): default
  • fromNT(str: any): any
  • graph(features?: any, opts?: any): Store
  • isBlankNode(obj: any): obj is BlankNode
  • TypeGuard for RDF/JS spec BlankNodes

    Parameters

    • obj: any

    Returns obj is BlankNode

  • isGraph(obj: any): obj is Quad_Graph
  • TypeGuard for valid RDF/JS Graph types

    Parameters

    • obj: any

    Returns obj is Quad_Graph

  • isLiteral(value: any): value is Literal
  • TypeGuard for RDF/JS spec Literals

    Parameters

    • value: any

    Returns value is Literal

  • isNamedNode(obj: any): obj is NamedNode
  • TypeGuard for RDF/JS spec NamedNodes

    Parameters

    • obj: any

    Returns obj is NamedNode

  • isPredicate(obj: any): obj is Quad_Predicate
  • TypeGuard for valid RDF/JS spec Predicate types

    Parameters

    • obj: any

    Returns obj is Quad_Predicate

  • isQuad(obj: any): obj is Quad<any, any, any, any>
  • TypeGuard for RDF/JS spec Quads

    Parameters

    • obj: any

    Returns obj is Quad<any, any, any, any>

  • isRDFObject(obj: any): obj is Quad_Object
  • TypeGuard for valid RDF/JS spec Object types

    Parameters

    • obj: any

    Returns obj is Quad_Object

  • isRDFlibObject(obj: any): obj is ObjectType
  • TypeGuard for valid RDFlib Object types, also allows Collections, Graphs

    Parameters

    • obj: any

    Returns obj is ObjectType

  • isRDFlibPredicate(obj: any): obj is Quad_Predicate
  • TypeGuard for valid RDF/JS spec Predicate types

    Parameters

    • obj: any

    Returns obj is Quad_Predicate

  • isRDFlibSubject(obj: any): obj is ObjectType
  • TypeGuard for valid RDFlib Subject types, same as Object as RDFLib symmetrical.

    Parameters

    • obj: any

    Returns obj is ObjectType

  • isStatement(obj: any): obj is Statement<SubjectType, PredicateType, ObjectType, GraphType>
  • TypeGuard for RDFLib Statements

    Parameters

    • obj: any

    Returns obj is Statement<SubjectType, PredicateType, ObjectType, GraphType>

  • isStore(obj: any): obj is Store
  • isSubject(obj: any): obj is Quad_Subject
  • TypeGuard for valid RDF/JS spec Subject types

    Parameters

    • obj: any

    Returns obj is Quad_Subject

  • isTerm(obj: any): obj is Term
  • isVariable(obj: any): obj is Variable
  • TypeGuard for RDFLib Variables

    Parameters

    • obj: any

    Returns obj is Variable

  • lit(val: string, lang?: string, dt?: NamedNode): Literal
  • literal(value: string, languageOrDatatype?: string | NamedNode): Literal
  • parse(str: string, kb: Formula, base: string, contentType?: string, callback?: CallbackFunc): void
  • Parse a string and put the result into the graph kb. Normal method is sync. Unfortunately jsdonld is currently written to need to be called async. Hence the mess below with executeCallback.

    Parameters

    • str: string

      The input string to parse

    • kb: Formula

      The store to use

    • base: string

      The base URI to use

    • contentType: string = 'text/turtle'

      The MIME content type string for the input - defaults to text/turtle

    • Optional callback: CallbackFunc

    Returns void

  • quad(subject: Term, predicate: Term, object: Term, graph?: Term): Statement<SubjectType, PredicateType, ObjectType, GraphType>
  • queryToSPARQL(query: any): string
  • serialize(target: null | Formula | NamedNode | BlankNode, kb: Formula, base?: unknown, contentType?: string, callback?: (err: undefined | null | Error, result?: string) => any, options?: { flags?: string; namespaces?: Record<string, string> }): string | undefined
  • Serialize to the appropriate format

    Parameters

    • target: null | Formula | NamedNode | BlankNode
    • kb: Formula
    • Optional base: unknown
    • Optional contentType: string
    • Optional callback: (err: undefined | null | Error, result?: string) => any
        • (err: undefined | null | Error, result?: string): any
        • Parameters

          • err: undefined | null | Error
          • Optional result: string

          Returns any

    • Optional options: { flags?: string; namespaces?: Record<string, string> }
      • Optional flags?: string

        A string of letters, each of which set an options e.g. deinprstux

      • Optional namespaces?: Record<string, string>

        A set of [prefix, uri] pairs that define namespace prefixes

    Returns string | undefined

  • sparqlUpdateParser(str: any, kb: any, base: any): { query: any }
  • st(subject: Quad_Subject, predicate: Quad_Predicate, object: Quad_Object, graph?: Quad_Graph): Statement<SubjectType, PredicateType, ObjectType, GraphType>
  • Parameters

    • subject: Quad_Subject
    • predicate: Quad_Predicate
    • object: Quad_Object
    • Optional graph: Quad_Graph

    Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>

  • term<T>(value: ValueType): T
  • Type parameters

    • T: FromValueReturns<any>

    Parameters

    • value: ValueType

    Returns T

  • termValue(node: string | Term): string
  • Retrieve the value of a term, or self if already a string.

    Parameters

    • node: string | Term

    Returns string

  • triple(subject: Term, predicate: Term, object: Term, graph?: Term): Quad<any, any, any, any>
  • Returns a new instance of Quad. If graph is undefined or null it MUST set graph to a DefaultGraph.

    Parameters

    • subject: Term
    • predicate: Term
    • object: Term
    • Optional graph: Term

    Returns Quad<any, any, any, any>

Generated using TypeDoc