Class RDFSerializer

Hierarchy

  • DataSerializer
    • RDFSerializer

Constructors

Properties

deserializer: Deserializer
engine: QueryEngine<IQueryContextCommon>
eventEmitter: EventEmitter<DefaultEventMap>
knownRDFTypes: Map<`http://${string}` | `https://${string}`, string[]> = ...
knownTypes: Map<string, Serializable<any>>
options: DataSerializerConfig = ...
serializer: Serializer

Methods

  • Clone a serializable object

    Type Parameters

    • T
    • D = T

    Parameters

    • object: T

      Serializable object

    • OptionaldataType: Constructor<D>

      Data type to clone to

    Returns D

    Cloned object

  • Deserialize data

    Type Parameters

    • T

    Parameters

    • serializedData: Thing

      Data to deserialze

    • OptionaldataType: Serializable<T>

      Optional data type to specify deserialization type

    Returns T

  • Deserialize data

    Type Parameters

    • T

    Parameters

    • serializedData: any[]

      Data to deserialze

    • OptionaldataType: Serializable<T>

      Optional data type to specify deserialization type

    Returns T | T[]

  • Type Parameters

    • T

    Parameters

    • subject: `http://${string}` | `https://${string}`
    • input: string
    • contentType: string = 'text/turtle'

    Returns T

  • Type Parameters

    • T

    Parameters

    • subject: `http://${string}` | `https://${string}`
    • subjects: Subject[]

    Returns T

  • Find the root TypedJSON metadata

    Parameters

    • proto: any

      Prototype of target

    Returns ObjectMetadata

    Root object metadata

    use DataSerializerUtils.getRootMetadata

  • Parameters

    • name: string

    Returns Serializable<any>

  • Get the TypedJSON metadata

    Parameters

    • proto: any

      Prototype of target

    Returns ObjectMetadata

    Root object metadata

    use DataSerializerUtils.getMetadata

    https://gist.github.com/krizka/c83fb1966dd57997a1fc02625719387d

  • Get the root TypedJSON metadata

    Parameters

    • proto: any

      Prototype of target

    Returns ObjectMetadata

    Root object metadata

    use DataSerializerUtils.getRootMetadata

    https://gist.github.com/krizka/c83fb1966dd57997a1fc02625719387d

  • Type Parameters

    • T

    Parameters

    • dataType: Serializable<T>

    Returns ObjectMemberMetadata

  • Initialize the RDF serializer

    Parameters

    • module: string

      Module to initialize

    Returns void

  • Type Parameters

    • T

    Parameters

    • dataType: Serializable<T>
    • identifier: any
    • baseUri: `http://${string}` | `https://${string}`

    Returns `http://${string}` | `https://${string}`

  • Manually register a new type

    Type Parameters

    • T

    Parameters

    • type: Serializable<T>

      Type to register

    • Optionalconverters: MappedTypeConverters<T>

      Optional converters

    Returns void

  • Serialize an object to an URI

    Type Parameters

    • T

    Parameters

    • data: T

      Data to serialize to an URI

    • OptionalbaseUri: `http://${string}` | `https://${string}`

      Base URI

    Returns `http://${string}` | `https://${string}`

    Resource URI

  • Stringify a thing to RDF graph construct

    Parameters

    • thing: any

      Thing to serialize

    • Optionaloptions: WriterOptions = {}

      Writer options

    Returns Promise<string>

    Promise of a stringified graph

  • Convert subjects to thing

    Parameters

    • subjects: Subject[]

      List of subjects

    • subject: `http://${string}` | `https://${string}`

      Main subject

    Returns Thing

    Thing

  • Convert thing to subjects

    Parameters

    • thing: Thing

      Thing to convert

    • OptionalbaseUri: `http://${string}` | `https://${string}`

      Base URI

    Returns Subject[]

    List of subjects

  • Unregister a type

    Parameters

    • type: Serializable<any>

      Type to unregister

    Returns void