Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IRdfProperty

Hierarchy

  • IRdfProperty

Index

Properties

Optional clazz

clazz: any

Used to identify type of object at runtime.

MUST be used if the property extends Object i.e Person {}

class Person {
    @RdfProperty({predicate: 'schema:hasFriend', clazz: Person})
    friend: Person;
}

this property is required for instances to be created when deserializing turtle to objects

Optional deserializer

deserializer: any

Optional inverseOfPredicate

inverseOfPredicate: string

Optional isArray

isArray: boolean

Specify if this is an array

this property is required for deserializing from turtle

class Person {
    @RdfProperty({predicate: 'schema:hasFriend', clazz: Person, isArray: true})
    friend: Person[];
}

or

class Person {
    @RdfProperty({predicate: 'schema:name', isArray: true})
    name: string[];
}

Optional isIRI

isIRI: boolean

Treat a string as IRI Resource

Optional lang

lang: string

language tag, i.e. 'en' or 'de' or 'ru', etc

class Person {
    @RdfProperty({predicate: 'schema:name', lang: 'en'})
    name: string;
}

predicate

predicate: string
predicate
  • Predicate in the form of prefix:somename or a full IRI

NOTE: @RdfPrefixes defining schema must be present for the following example

 class Person {
     @RdfProperty({predicate: 'schema:name', lang: 'en'})
     name: string;
 }

or if @RdfPrefixes were not defined

 class Person {
     @RdfProperty({predicate: 'http://schema.org/name', lang: 'en'})
     name: string;
 }

Optional serializer

serializer: any

Serializer must either extend AbstractBNodeSerializer class or implement the IRDFSerializer interface

Optional xsdType

xsdType: string

XSDDataType can be used or a string

class Person {
    @RdfProperty({predicate: 'schema:name', xsdType: XSDDataType.XSD_STRING})
    name: string;
}

Generated using TypeDoc