-import { Hydra } from 'alcaeus'
+import Hydra from 'alcaeus'
-import { Vocab } from 'alcaeus'
Was string
.
Now is NamedNode | BlankNode
More conveniently referred to as import { ResourceIdentifier } from 'alcaeus'
API Documentation resources are downloaded automatically but as a separate promise
import Hydra from 'alcaeus'
const resoruce = await Hydra.loadeResource(uri)
+const docs: ApiDocumentation[] = await Hydra.apiDocumentations
Changed implementation, now extends Set<RdfResource>
- All resource interface lose the
I
prefix according to TypeScript best practices - additionally, all can be imported from main module
-import { IOperation } from 'alcaeus/types/Resources'
+import { Operation } from 'alcaeus'
-invokeOperation(operation: Operation, uri: string, body?: BodyInit, headers?: string | HeadersInit): Promise<HydraResponse>;
+invokeOperation(operation: Operation, body?: BodyInit, headers?: string | HeadersInit): Promise<HydraResponse>;
The called URI is retrieved from the id of operation.target
Parsers have to be added explicitly to have Alcaeus recognize RDF serializations. Either one-by-one
import Hydra from 'alcaeus'
import ParserJsonLd from '@rdfjs/parser-jsonld'
Hydra.parsers.set('application/ld+json', new ParserJsonLd())
Or importing a set of common parser (large in size; not ideal for browser)
import Hydra from 'alcaeus'
import { parsers } from '@rdfjs/formats-common'
parsers.forEach((parser, mediaType) => Hydra.parsers.set(mediaType, parser))