The Counter Ontology

Hello again 😉

Over the last weeks, I also co-developed the Counter Ontology. This ontology is a generalisation of the Playcount Ontology from Yves Raimond. It includes a general multiple purpose counter concept, which could be uses to associate any concept to a co:Counter instance(s) with the property co:counter or a specific sub property of it.

The Counter Ontology - Counter concept as graph with relations

The second property of co:Counter is co:count, which is a simple xsd:integer based datatype property. That means you could use this concept for things like for example play counter, skip counter or website hit counter.

The Counter Ontology - Scrobble event concept as graph with relations

Furthermore, this ontology includes already a predefined property to associate event (event:Event) specific counter to its related events (co:event_counter, co:event), e.g. a co:ScrobbleEvent to scrobble something. This enables the opportunity to trace back all related events, which are responsible for a specific count. Of course, this is also possible with all other concepts 😉

@prefix bibo: <http://purl.org/ontology/bibo/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix co: <http://purl.org/ontology/co/core#> .
@prefix ex: <http://example.org/> .
 
ex:WebpageCounter a co:Counter ;
   dc:title "Webpage Counter"^^xsd:string ;
   dc:creator <http://foaf.me/zazi#me> ;
   dc:description "A counter of a specific web page"^^xsd:string ;
   co:count 10 .
 
<https://smiy.wordpress.com/> a bibo:Document ;
   co:counter ex:WebpageCounter .

A simple use case of the Counter Ontology is a website hit counter as described in the RDF/Turtle representation above (see also RDF and N3 for downloadable representations of this example). This examples shows, how a co:Counter instance could be used as a counter for a specific webpage (here of the type bibo:Document). Toby Inkster implemented an example of a webpage counter based on the Counter Ontology in PHP, which is available here.

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix co: <http://purl.org/ontology/co/core#> .
@prefix mo: <http://purl.org/ontology/mo/> .
@prefix ex: <http://example.org/> .
@prefix event: <http://purl.org/NET/c4dm/event.owl#> .
@prefix time: <http://www.w3.org/2006/time#> .
 
ex:PlayBackCounter a co:Counter ;
   dc:title "Play Back Counter"^^xsd:string ;
   dc:creator <http://foaf.me/zazi#me> ;
   dc:description "A play back counter of a specific music track"^^xsd:string ;
   co:count 2 ;
   co:object ex:SexMachine .
 
ex:SexMachine a mo:Track ;
   dc:title "Sex Machine"^^xsd:string ;
   dc:creator <http://dbpedia.org/resource/James_Brown> .
 
ex:SexMachineSE1 a co:ScrobbleEvent ;
   event:time [
      a time:Instant ;
      time:inXSDDateTime "2010-07-15T11:21:52+01:00"^^xsd:dateTime
      ] ;
   event:agent <http://foaf.me/zazi#me> ;
   co:event_counter ex:PlayBackCounter .
 
ex:SexMachineSE2 a co:ScrobbleEvent ;
   event:time [
      a time:Instant ;
      time:inXSDDateTime "2010-07-15T11:27:52+01:00"^^xsd:dateTime
      ] ;
   event:agent <http://foaf.me/zazi#me> ;
   co:event_counter ex:PlayBackCounter .

A bit more complex use case is a play back counter of a music track, which is related to all relevant play back events of this music track. This example is described in the RDF/Turtle representation above (see also RDF and N3 for downloadable representations of this example). It shows, how a co:Counter instance could be used as a play back counter for a specific music track (here of the type mo:Track). Each time, when this specific music track was played, a co:ScrobbleEvent instance was created and linked to its playback counter with the property co:event_counter.

As you can see the use cases of the Counter Ontology are diverse. The counter concept is currently also specified in the Play Back Ontology, which defines a pbo:MediaActionCounter concept, where specific media action counter can be derived from, e.g. pbo:PlayBackCounter or pbo:SkipCounter.

I especially would like to thank very much Yves Raimond and Mats Skillingstad to help to establish this multiple purpose counter ontology and Toby Inkster for providing the web counter example. Please feel free to reuse the Counter Ontology also for your own projects (let me know your use cases 😉 ). Comments, suggestions and critics are also very welcome.

Cheers,

Bob

Posted in announcement | Tagged , , , , , , , , , , , , | 2 Comments

The Ordered List Ontology

Over the last weeks, I co-developed the Ordered List Ontology. This is an ontology for describing ordered lists, which are also know as sequences. This concept is the result of a discussion about how to model playlists (especially of music tracks) and was proposed by Samer A. Abdallah.

The Ordered List Ontology - concepts and relations

It consists of two concepts – olo:OrderedList and olo:Slot. That means an ordered list is a composite of all slots, which are part of this ordered list (related by the property olo:slot). Although, the Ordered List Ontology is OWL based, the ontology also provides “backward” compatibility to the RDFS world.
The initial and primary access method to single slots in an ordered list should be olo:index, because this property represents the fixed index of a slot in an ordered list. Thereby, the property olo:length relates to the length of an ordered list, the number of included slots. The secondary access method is its (currently) optional iterator olo:next as shortcut to the next slot in the list. The items, which are arranged in an ordered list, are associated by the property olo:item to a slot.
Since, the Ordered List Ontology won’t restrict its users in how they have to apply the ontology, all properties also have an inverse property. These are explicitly defined for inverse properties, which introduce also a new meaning (olo:ordered_list, olo:previous), and anonymous defined for the rest of the inverse properties.

The Ordered List Ontology - Playlist example

An use case of the Ordered List Ontology is for example a music playlist (see also RDF and N3 for downloadable representations of this example). This example is illustrated in the graphic above and in the RDF/Turtle representation below.
The whole music playlist is an olo:OrderedList* instance and could be annotated with further editoral metadata, e.g. a title, a description and a creator. Each track (mo:Track) of the music playlist is embedded into an olo:Slot instance. The music playlist has a fixed length (olo:length) and each slot has a fixed index (olo:index) in the ordered list it belongs to.

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix olo: <http://purl.org/ontology/olo/core#> .
@prefix mo: <http://purl.org/ontology/mo/> .
@prefix ex: <http://example.org/> .
 
ex:FunkyPlaylist a olo:OrderedList ;
   dc:title "Funky Playlist"^^xsd:string ;
   dc:description "A playlist full of funky legends"^^xsd:string ;
   dc:creator <http://foaf.me/zazi#me> ;
   olo:length 2 ;
   olo:slot [
   a olo:Slot ;
      olo:index 1 ;
   olo:item ex:SexMachine
   ] ;
   olo:slot [
   a olo:Slot ;
      olo:index 2 ;
      olo:item ex:GoodFoot
   ] .
 
ex:SexMachine a mo:Track ;
   dc:title "Sex Machine"^^xsd:string ;
   dc:creator <http://dbpedia.org/resource/James_Brown> .
 
ex:GoodFoot a mo:Track ;
   dc:title "Good Foot"^^xsd:string .

Please feel free to reuse the Ordered List Ontology also for your own projects (let me know your use cases 😉 ). Comments, suggestions and critics are also very welcome.

Cheers,

Bob

PS: Thanks to all people, which helped the Ordered List Ontology to what it is now (Samer A. Abdallah, Kurt Jacobson, Yves Raimond, Mats Skillingstad, Aldo Gangemi, …)

*) Of course, one could also sub class olo:OrderedList for a more specific playlist concept

Posted in announcement | Tagged , , , , , , , , , | 3 Comments

My SpecGen version 6

SpecGen is a specification documentation generator (written in Python) for Semantic Web ontology documentation generation assistance. I like to announce my modified, extended and more generalized version of Danbri‘s SpecGen* version 5 (written in Python). My SpecGen version 6 is able to generate a XHTML+RDFa ontology specification with common concepts and properties based on OWL, RDFS and RDF, and parse these statements into a template of the ontology documentation.
Besides a new parameter for an input ontology file, I modified and extended especially the libvocab.py with the following modeling features (i.e. read these features out of the ontology file and generate appropriate XHTML+RDFa):

  • multiple property and class types
  • muttiple restrictions modelling
  • rdfs:label, rdfs:comment
  • classes and properties from other namespaces
  • inverse properties (explicit and anonymous)
  • sub properties
  • union ranges and domains (appear only in the property descriptions, not on the class descriptions)
  • equivalent properties
  • simple individuals as optional feature

With this script I generated the following specifications:

Feel free to also modify and extend this script, because it is just the beginning of a nice XHTML+RDFa mapping for ontology specification in documentations. The following task are still TODO:

  • enable more OWL features, especially an automated construction of owl:Ontology (currently this must be done manually in the template)
  • enable more support for other namespaces (super classes and super properties from other namespaces already possible)
  • restructure the code !!!
  • write a cool parser for the “\n”‘s and “\t”‘s etc. in the parsed comments (e.g. “\n” to
    …)

PS: A zipped packaged of my SpecGen version 6, can be downloaded here. Please have a look at the README file and the introduction comments of libvocab.py.

*) see SpecGen for the original SpecGen implementation and its versions.

Posted in announcement | Tagged , , , , , , , , , | Leave a comment

Hello world!

More information coming soon!

Bob

Posted in announcement | Tagged | Leave a comment