
Security News
Critical Security Vulnerability in React Server Components
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.
@openhps/rdf
Advanced tools

This OpenHPS module adds RDF data support to the OpenHPS framework. The main vocabulary used for serializing data is the POsitioning System Ontology (POSO) ontology that was presented at ISWC 2022.
If you have npm installed, start using @openhps/rdf with the following command.
npm install @openhps/rdf --save
openhps-rdf.js: CJS export of RDF mappings, SPARQL data serviceopenhps-rdf.vocab.js: CJS export of common RDF vocabulariesopenhps-rdf.serialization.js: CJS export of RDF serializationopenhps-rdf.sparql.js: CJS export of SPARQL data service and serializationopenhps-rdf.all.js: CJS export of RDF mappings, SPARQL data service and vocabulariesopenhps-rdf.es.js: ESM export of RDF mappings, SPARQL data serviceopenhps-rdf.vocab.es.js: ESM export of common RDF vocabulariesopenhps-rdf.serialization.es.js: ESM export of RDF serializationopenhps-rdf.sparql.es.js: ESM export of SPARQL data service and serializationopenhps-rdf.all.es.js: ESM export of RDF mappings, SPARQL data service and vocabulariesEach export has a *.min.js version that is minified. For production environments it is recommended to use openhps-rdf.minimal in combination with a Comunica engine.
RDFSerializerThe RDFSerializer is a similar utility as the DataSerializer from @openhps/core. Instead of serializing and deserializing to JSON, it converts to RDF triples.
Serialize a serializable object to an RDF thing.
import { RDFSerializer, Thing } from '@openhps/rdf';
const thing: Thing = RDFSerializer.serialize(new DataObject(/* ... */));
When storing a named object, a base URI should be provided.
Serialize a serializable object to RdfJS Quads.
import { RDFSerializer } from '@openhps/rdf';
import { Quad } from 'rdfjs';
const quads: Quad[] = RDFSerializer.serializeToQuads(new DataObject(/* ... */));
When storing a named object, a base URI should be provided.
Serializing to a string is possible. We use N3 for exporting the serializable objects to turtle, Notation-3 or other supported formats.
import { RDFSerializer } from '@openhps/rdf';
const turtle: string = RDFSerializer.stringify(new DataObject(/* ... */), {
format: 'text/turtle',
prettyPrint: true
});
Deserialize a serializable object from a thing.
import { RDFSerializer, Thing } from '@openhps/rdf';
const thing: Thing
/* ... */
const object: DataObject = RDFSerializer.deserialize(thing);
SerializableObjectimport '@openhps/rdf'; // Import to load type declarations
import { SerializableObject, SerializableMember } from '@openhps/core';
@SerializableObject({
rdf: {
type: 'http://myontology.org#SomeObject'
}
})
class SomeObject {
}
SerializableMemberAPI documentation for literal: https://openhps.org/docs/rdf/interfaces/rdfliteraloptions
import { SerializableMember, SerializableObject } from "@openhps/core";
import { foaf } from "@openhps/rdf";
@SerializableObject({
rdf: {
type: foaf.Project
}
})
export class Project {
@SerializableMember({
rdf: {
predicate: foaf.name
}
})
name: string;
}
SPARQLDataDriverThe SPARQL endpoint uses Comunica as its query engine while still using the query syntax from MongoDB.
import { ModelBuilder, DataObject, DataObjectService } from '@openhps/core';
import { SPARQLDataDriver, DefaultEngine } from '@openhps/rdf';
ModelBuilder.create()
.addService(new DataObjectService(new SPARQLDataDriver(DataObject, {
httpAuth: "admin:test",
baseUri: "http://openhps.org/terms#",
sources: [{ type: 'sparql', value: "http://localhost:3030/openhps-rdf-1" }],
engine: DefaultEngine
})))
.from()
.to()
.build();
Use of OpenHPS, contributions and feedback is highly appreciated. Please read our contributing guidelines for more information.
Copyright (C) 2019-2025 Maxim Van de Wynckel & Vrije Universiteit Brussel
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
FAQs
Open Hybrid Positioning System
We found that @openhps/rdf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.

Research
/Security News
We spotted a wave of auto-generated “elf-*” npm packages published every two minutes from new accounts, with simple malware variants and early takedowns underway.

Security News
TypeScript 6.0 will be the last JavaScript-based major release, as the project shifts to the TypeScript 7 native toolchain with major build speedups.