Skip to content

using and propertymap

webr3 edited this page Nov 21, 2010 · 1 revision

.using()

Sometimes basic properties on objects can be ambiguous, when you write o.title js3 will default to mapping this to dc:title, however you may have meant dc11:title or even foaf:title.

To cater for this, js3 provides the .using() method on objects, which allows you to specify just which ontologies should be looked in (first) to resolve terms.

Example usage:

var article = {
  title: "Something about using",
  description: "Just a little bit of text here",
}.ref();

article.n3()                      // dc:title, dc:description
article.using('dc11').n3()   // dc11:title, dc11:description

Current Ambiguities

Out of the ~400 properties known by the js3 library, the following are ambiguous. In each case the first member of the list is the default mapping.

  • type -> rdf:type, dc:type, dc11:type - note: *use "a" instead for rdf:type"
  • subject -> rdf:subject, dc:subject, dc11:subject
  • object -> rdf:object, sioca:object
  • member -> rdfs:member, foaf:member, skos:member, org:member
  • logo -> wdrs:logo, foaf:logo
  • name -> foaf:name, sioc:name
  • topic -> foaf:topic, sioc:topic
  • note -> sioc:note, skos:note
  • location -> wgs84:location, org:location
  • title -> dc:title, dc11:title, foaf:title
  • creator -> dc:creator, dc11:creator
  • description -> dc:description, dc11:description
  • publisher -> dc:publisher, dc11:publisher
  • contributor -> dc:contributor, dc11:contributor
  • date -> dc:date, dc11:date
  • format -> dc:format, dc11:format
  • identifier -> dc:identifier, dc11:identifier, org:identifier
  • source -> dc:source, dc11:source, sioca:source
  • language -> dc:language, dc11:language
  • relation -> dc:relation, dc11:relation
  • coverage -> dc:coverage, dc11:coverage
  • rights -> dc:rights, dc11:rights
  • requires -> dc:requires, cc:requires
  • license -> dc:license, cc:license
Clone this wiki locally