wiki:DespoinaLog/2010/10/28

Version 9 (modified by antonak, 14 years ago) (diff)

--

  • molgenis3_3 is not connected to svn (probably after helios installation) . molgenis4pheno is working.
  • New molgenis project in molgenis4phenotypeWorkspaceHeliosCocoa32 with name molgenis ...and it's working with molgenis4pheno

External Ontology

(see relative message including Pedro Lopes, Richard Cyganiak)

How to connect multiple semantic systems, some using D2R and some purely semantic :

  • learn basics of D2RQ mapping language, modify the mapping file that you probably created using generate-
    mapping. This is probably the file that lives in molgenis_distro (generated by d2rq) : WebContent/WEB-INF/molgenis-rdf-mapping.n3

For instance how to define mappings that explicitly say that a table column corresponds to an element of the FOAF ontology ?

  • In the mapping file there is a class map corresponding to each table . Find the right class map . below the class map ,there is a property bridge for each column .
@prefix map: <file:///stdout#> .
@prefix db: <> .
@prefix vocab: <http://localhost:8080/molgenis_distro/vocab/resource/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
@prefix jdbc: <http://d2rq.org/terms/jdbc/> .
@prefix d2r: <http://sites.wiwiss.fu-berlin.de/suhl/bizer/d2r-server/config.rdf#> .

<> a d2r:Server;
    rdfs:label "D2R Server";
    d2r:baseURI <http://localhost:8080/pheno/>;
    d2r:port 8080;
    d2r:documentMetadata [
        rdfs:comment "This comment is custom document metadata.";
    ];
	d2r:vocabularyIncludeInstances true;    
    .# Should be jndi loaded!
map:database a d2rq:Database;
	d2rq:jdbcDriver "com.mysql.jdbc.Driver";
	d2rq:jdbcDSN "jdbc:mysql://localhost/bbmri";
	d2rq:username "molgenis";
	d2rq:password "molgenis";
	jdbc:autoReconnect "true";
	jdbc:zeroDateTimeBehavior "convertToNull";
	.
# Entity Investigation
map:Investigation a d2rq:ClassMap;
	d2rq:dataStorage map:database;
	d2rq:uriPattern "Investigation/@@Investigation.id@@";
	d2rq:class vocab:Investigation;
	d2rq:classDefinitionLabel "";
	d2rq:classDefinitionComment " Investigation defines self-contained units of study. For example: Framingham study. Optionally a description and an accession to a data source can be provided. Each Investigation has a unique name and a group of subjects of observation (ObservableTarget), traits of observation (ObservableFeature), results (in ObservedValues), and optionally actions (Protocols, ProtoclApplications). Maps to XGAP/FuGE Investigation, MAGE-TAB Experiment and METABASE:Study. ";
	.	.................................................................................................................................................
	.	.................................................................................................................................................
	.	.................................................................................................................................................
map:Investigation_description a d2rq:PropertyBridge;
	d2rq:belongsToClassMap map:Investigation;
	d2rq:property vocab:Investigation_description;
	d2rq:propertyDefinitionLabel "description";
	d2rq:propertyDefinitionComment "(Optional) Rudimentary meta data about the Investigation";
	d2rq:column "Investigation.description";
	d2rq:datatype xsd:text;
	.
  • Find the right class map. Below the class map, there's a property bridge for each column. Find the right one.
  • Change its d2rq:property value to the FOAF term, e.g., foaf:name.
  • You also have to make sure that the FOAF namespace is declared in the @prefix section at the very beginning of the file.

When there is a table column whose values map elements from the DailyMed D2R database?

  • Instead of mapping the column to a literal with d2rq:column, use a d2rq:uriPattern that produces URIs that match the URIs in the other dataset.

next todos:

  • Change its d2rq:property value to the FOAF term, e.g., foaf:name.
  • You also have to make sure that the FOAF namespace is declared in the @prefix section at the very beginning of the file.