
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A very friendly and tight semantic-graph database layer inspired by OWL and RDF over mongodb
A very friendly semantic-graph database base layer.
Along the decades of programming i've accumulated, i found that semantic graphs as well as table and documents are needed in almost all real-world applications, if you want a clean design/implementation and painless functional scalability. Reality simply dictates more and more connections and business logic that will be added - sometimes on a daily basis - and such a multi-model approach provides a clean way to help with that, in the modeling aspect. I implemented such a database layer several times, in different languages: One in C++, very special, for a rather special application, later on, twice in Java - both were rather extensive, the first was performance optimized and the later very extensive and supported also sophisticated semantic tagging, aspect-oriented based features, and more and later on, a simple Javascript implementation, that expanded into a richer one which served be in a few projects and supported also quite a few useful, advanced features. This is the evolution of the later, stripped of any of the extra features and focused on the essence. The extra features would soon come in separated libraries (on is already released: am-i-allowed) that are agnostic of even towards Semantix.
This layer is very agnostic, unlike anything else i've seen yet, and it evolved from several real-world projects and yet it is brand new, without any tech debt, using the most modern language features. It is built to be expanded, as i described above and it has some small unique features, but nothing, yet, dramatic. i will make sure it continues to evolve elegantly, because that's what i like, and i'll listen to your feedbacks.
It lets you connect entities with named predicates, for example:
George[:Person] ----worksFor[position:CTO]---> Hooli[:Company]
...and easily query the graph.
It also add an ontology, by which such predicates (=relations) and entity types could be defined as well as rules. It makes building even complex models very easy and readable.
You can still work with the data as tables and documents when it suits you, or even have collections that are "normal".
Basically, it is agnostic to the underlying database engine but current it uses MongoDB.
This library was already used in several projects, and it is in the process of revising as a standalone npm package.
Entity a node in the graph that may contain data in the form of fields and may connect to other
entities view Predicates. It is an instant of a class of your own, which should extend AbstractEntity.
Entity Descriptor provides metadata per entity/entity-type, such as the implementing class, and the template (entity fields definition, validation, initializers, if needed...) and optionally things like extra index definitions and more.
Predicate perdicates are the connection between the nodes (entities) of the graph (such as "owns", "likes", etc). You can also place a payload on a predicate instance (e.g. "levelOfLikeness") as well as define special keys to it (for special sort and searches)
Predicat Descriptor contains the metadata of a predicate, including its type ("owns", "likes") and its features (payload, keys) and its semantic parent if it has one.
Semantic Inheritence if a predicate descriptor X, for example, is the parent of predicate Y, then a predicate query of X will return also the Ys.
npm i semantix
Basically. you need to:
MongoStore and connect to it.AbstractEntity, with their entity descriptors.SemanticPackage and supply it with the store and the ontologySemanticPackage instance is your main interface for most entity and predicate CRUD operations.
let sp: SemanticPackage
const storage = new MongoStorage('mongodb://localhost/testing-semantix');
await storage.connect()
await storage.purgeDatabase()
sp = new SemanticPackage('main', {
entityDcrs: [Person.dcr, WorkPlace.dcr],
predicateDcrs: [worksFor]
}, storage)
const george = <Person>await sp.createEntity(Person.dcr, {name: 'George'})
const hooli = <WorkPlace>await sp.createEntity(WorkPlace.dcr, {name: 'Hooli'})
const job = await sp.createPredicate(george, worksFor, hooli, {position: 'CTO'})
const foundPredicates = await hooli.incomingPreds(worksFor, {projection: ['name']})
// this `expect` is from the chai library
expect(foundPredicates.some(p => p.dcr === worksFor)).to.be.true;
class Person extends AbstractEntity {
static template: EntityTemplate = {
name: joi.string().required()
};
static readonly dcr = new EntityDcr(Person, Person.template)
}
class WorkPlace extends AbstractEntity {
static template: EntityTemplate = {
name: joi.string().required()
};
static readonly dcr = new EntityDcr(WorkPlace, WorkPlace.template)
}
const worksFor = new PredicateDcr('worksFor', [], {}, {
position: joi.string(),
start: joi.date(),
end: joi.date(),
})
FAQs
A very friendly and tight semantic-graph database layer inspired by OWL and RDF over mongodb
We found that semantika demonstrated a not healthy version release cadence and project activity because the last version was released 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.