RVL by Example

The following serves as a collection of RVL mappings and the corresponding generated d3.js graphics for learning RVL by example. Examples are from various domains, such as the life sciences and the field of library data and puplication.

Citation Typing Ontology (CiTO)

Example of using directed linking to visualize the citation relations between a set of documents. The citation relations are stated using cito:cites or sub-properties of this property defined in the Citation Typing Ontology (CiTO). The subproperties (e.g. cito:confirms) are distinguished by a color encoding, which is realized via a sub-mapping:

:Cites2Linking
      a rvl:PropertyMapping ;
      rvl:sourceProperty cito:cites ;
      rvl:targetObjToObjRelation vg:Linking_Directed_Relation ;
      rvl:subMapping [
        rvl:subMapping-onRole vg:linking_connector;
        rvl:subMapping-onTriplePart rdf:predicate;
        rvl:subMapping-mapping :PredicateID2Color;
      ].

:PredicateID2Color
      a rvl:PropertyMapping ;
      rvl:sourceProperty rdf:ID ;
      rvl:targetAttribute vg:color_named ;
      rvl:valueMapping [
        rvl:sourceValueOrderedSet (
            cito:confirms cito:cites cito:critiques
        );
        rvl:targetValueList (
            vg:Green vg:Yellow vg:Red
        );
      ].

The same mappings rendered with a tree layout:

Amino Acids Ontology

Example of using shape for distinguishing various classes of amino acids from the Amino Acids Ontology (blog post | latest version) by their side chain structure. Note that hasSideChainStructure is only used in allValuesFrom-restrictions on classes – there are no instances of amino acids in the ontology. Therefore, we extend the mapping to include these relations between classes using rvl:inheritedBy.

@prefix :            <http://purl.org/viso/example/amino-acids/> .
@prefix amino-acid:  <http://www.co-ode.org/ontologies/amino-acid/2006/05/18/amino-acid.owl#> .
@prefix bio:         <http://purl.org/viso/addon/shapes/bio/> .
@prefix rvl:         <http://purl.org/rvl/> .
@prefix vg:          <http://purl.org/viso/graphic/> .
...

:SideChainStructure2Shape
      a rvl:PropertyMapping ;
      rvl:sourceProperty amino-acid:hasSideChainStructure ;
      rvl:inheritedBy owl:allValuesFrom ;
      rvl:targetAttribute
              vg:shape_named ;
      rvl:valueMapping :Aromatic_to_Shape2 , :Aliphatic_to_Shape1 .

:Aliphatic_to_Shape1
      a rvl:ValueMapping ;
      rvl:sourceValue amino-acid:Aliphatic ;
      rvl:targetValue bio:Aliphatic_Shape .

:Aromatic_to_Shape2
      a rvl:ValueMapping ;
      rvl:sourceValue amino-acid:Aromatic ;
      rvl:targetValue bio:Aromatic_Shape .

Plant Ontology

Showing part-of relations in the Plant Ontology by containment:

@prefix rvl:     <http://purl.org/rvl/> .
@prefix vg:      <http://purl.org/viso/graphic/> .
@prefix obo-owl: <http://purl.org/obo/owl/obo#> .
@prefix obo-rel: <http://purl.org/obo/owl/OBO_REL#> .
@prefix po:      <http://purl.org/obo/owl/PO#> .
...

:ContainmentMapping
      a rvl:PropertyMapping ;
      rvl:subjectFilter
           "http://www.w3.org/2000/01/rdf-schema#subClassOf::http://purl.org/obo/owl/PO#PO_0025059"^^rvl:fslSelector;
      rvl:sourceProperty obo-rel:part_of ;
      rvl:invertSourceProperty "true"^^xsd:boolean;
      rvl:inheritedBy owl:someValuesFrom;
      rvl:targetObjToObjRelation vg:Containment_Relation .


(d3.js rendering based on based on http://bl.ocks.org/mbostock/7607535)

:PropertyToLinkingByConnectorMapping
      a rvl:PropertyMapping ;
      rvl:subjectFilter " ?s rdfs:subClassOf ?restriction .
                          ?restriction owl:onProperty obo:develops_from .
                          ?restriction owl:someValuesFrom  po:PO_0005599 .
                          "^^rvl:sparqlSelector;
      rvl:sourceProperty <http://purl.org/obo/owl/obo#develops_from> ;
      rvl:invertSourceProperty "true"^^xsd:boolean;
      rvl:inheritedBy owl:someValuesFrom;
      rvl:targetObjToObjRelation vg:Linking_Directed_Relation ;
      rvl:subMapping [
        rvl:subMapping-onRole vg:linking_connector;
        rvl:subMapping-onTriplePart rdf:predicate;
        rvl:subMapping-mapping :PMfromID2Width;
      ],[
        rvl:subMapping-onRole vg:linking_connector;
        rvl:subMapping-onTriplePart rdf:predicate;
        rvl:subMapping-mapping :ArrowShapeMapping;].

  :ShapeMapping a rvl:PropertyMapping ;
      rvl:sourceProperty rdfs:subClassOf ;
    	  rvl:subjectFilter "http://www.w3.org/2000/01/rdf-schema#subClassOf::http://purl.org/obo/owl/PO#PO_0025059"^^rvl:fslSelector;
      rvl:targetAttribute vg:shape_named ;
      rvl:valueMapping [
      	rvl:sourceValue ;
      	rvl:targetValue common-shapes:FlowArrow; ].

  :PMfromID2Width a rvl:PropertyMapping ;
      rvl:disabled "true"^^xsd:boolean ;
 	  rvl:sourceProperty rdf:ID ;
 	  rvl:targetAttribute vg:width ;
 	  rvl:valueMapping [
        rvl:sourceValue <http://purl.org/obo/owl/obo#develops_from> ;
		rvl:targetValue "23"^^xsd:float ; ]. 

   :ArrowShapeMapping a rvl:PropertyMapping ;
      rvl:disabled "true"^^xsd:boolean ;
      rvl:sourceProperty rdf:ID ;
      rvl:targetAttribute vg:shape_named ;
      rvl:valueMapping [
		rvl:sourceValue <http://purl.org/obo/owl/obo#develops_from> ;
        rvl:targetValue common-shapes:Line ; ].

Leave a Reply