Skip to content
SNM-I

External dependencies

Node packages

Data storage technologies

MongoDB

We use MongoDB to store user information, mongoose for modelling the data, and mongoose-gridfs for using the GridFS API.

Ontotext GraphDB

We use GraphDB to store the rest of the data. The GraphDB interface can be accessed at http://localhost:7200 after you start the docker container. You can use the interface to write SPARQL queries. There will be a tutorial for the interface the first time you launch it.

RDF (Resource Description Framework)

RDF is a framework and a standard for representing and describing information on the web.

In RDF, information is represented using triples, consisting of three parts:

  • Subject: The resource being described
  • Predicate: The attribute of the resource
  • Object: The value or target of the attribute

For example, a user named Parker with the user id of 1 can be represented as the following:

  • Subject: user_1
  • Predicate: hasName
  • Object: Parker

Parker may have other attributes, such as age, represented in another triple:

  • Subject: user_1
  • Predicate: hasAge
  • Object: 21

SPARQL

SPARQL is a query language for RDF data.

Here are some examples of SPARQL queries corresponding to the javascript code:

Find all primary contacts
const all_primary_contact = PrimaryContactModel.find({})
PREFIX : <http://cmmp#>
CONSTRUCT {
  ?s ?p0 ?o0
} WHERE {
  ?s ?p0 ?o0.
  ?s rdf:type owl:NamedIndividual, :primary_contact.
}

Find all primary contacts with the last name Parker

const primary_contacts_with_last_name = PrimaryContactModel.find({last_name: "Parker"})
PREFIX : <http://cmmp#>
CONSTRUCT {
  ?s ?p0 ?o0
} WHERE {
  ?s ?p0 ?o0.
  ?s rdf:type owl:NamedIndividual, :primary_contact.
  ?s :has_last_name ?o0_0.
  FILTER(?o0_0 = "Parker")
}

Find a primary contact with the last name Parker and the email user@example.com

const primary_contact_with_email = PrimaryContactModel.find({last_name: "Parker", email: "user@example.com"})
PREFIX : <http://cmmp#>
CONSTRUCT {
  ?s ?p0 ?o0
} WHERE {
  ?s ?p0 ?o0.
  ?s rdf:type owl:NamedIndividual, :primary_contact.
  ?s :has_last_name ?o0_0.
  FILTER(?o0_0 = "Parker")
  ?s :has_email ?o0_3.
  FILTER(?o0_3 = "user@example.com")
}