| 1 | <xsl:stylesheet version="1.0"
|
|---|
| 2 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|---|
| 3 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|---|
| 4 | xmlns:pdbx="http://pdbj.protein.osaka-u.ac.jp/XML/pdbmlplus/pdbMLplus_v32.xsd"
|
|---|
| 5 | xmlns:pdb="http://www.pdbj.org/ontology/pdb.owl#"
|
|---|
| 6 | xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|---|
| 7 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|---|
| 8 | xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
|
|---|
| 9 | xmlns:ro="http://www.obofoundry.org/ro/ro.owl#"
|
|---|
| 10 | xmlns:foaf="http://xmlns.com/foaf/0.1/"
|
|---|
| 11 | xmlns:bibo="http://purl.org/ontology/bibo/"
|
|---|
| 12 | xmlns:dc="http://purl.org/dc/elements/1.1/">
|
|---|
| 13 | <xsl:output method="xml" indent="yes"/>
|
|---|
| 14 |
|
|---|
| 15 | <xsl:template match="/">
|
|---|
| 16 | <rdf:RDF>
|
|---|
| 17 | <xsl:apply-templates/>
|
|---|
| 18 | </rdf:RDF>
|
|---|
| 19 | </xsl:template>
|
|---|
| 20 |
|
|---|
| 21 | <xsl:template match="pdbx:datablock">
|
|---|
| 22 | <xsl:variable name="base" select="concat('http://www.pdbj.org/', translate(./pdbx:entryCategory/pdbx:entry/@id, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'))"/>
|
|---|
| 23 | <pdb:Structure rdf:about="{$base}">
|
|---|
| 24 | <xsl:apply-templates select="pdbx:database_PDB_revCategory/pdbx:database_PDB_rev"/>
|
|---|
| 25 | <xsl:apply-templates select="pdbx:entityCategory/pdbx:entity">
|
|---|
| 26 | <xsl:with-param name="base" select="$base"/>
|
|---|
| 27 | </xsl:apply-templates>
|
|---|
| 28 | <xsl:apply-templates select="pdbx:citationCategory/pdbx:citation"/>
|
|---|
| 29 | </pdb:Structure>
|
|---|
| 30 | </xsl:template>
|
|---|
| 31 |
|
|---|
| 32 | <xsl:template match="pdbx:entity">
|
|---|
| 33 | <xsl:param name="base"/>
|
|---|
| 34 | <xsl:variable name="id" select="@id"/>
|
|---|
| 35 | <ro:contains>
|
|---|
| 36 | <xsl:element name="{pdbx:type}" namespace="http://www.pdbj.org/ontology/pdb.owl#">
|
|---|
| 37 | <xsl:attribute name="rdf:about"><xsl:value-of select="concat($base, '#', $id)"/></xsl:attribute>
|
|---|
| 38 | <xsl:apply-templates select="pdbx:pdbx_description"/>
|
|---|
| 39 | <xsl:apply-templates select="/pdbx:datablock/pdbx:entity_src_genCategory/pdbx:entity_src_gen[@entity_id=$id]"/>
|
|---|
| 40 | <xsl:apply-templates select="/pdbx:datablock/pdbx:struct_refCategory/pdbx:struct_ref[@id=$id]"/>
|
|---|
| 41 | </xsl:element>
|
|---|
| 42 | </ro:contains>
|
|---|
| 43 | </xsl:template>
|
|---|
| 44 |
|
|---|
| 45 | <xsl:template match="pdbx:struct_ref[pdbx:db_name='UNP']">
|
|---|
| 46 | <rdfs:seeAlso rdf:resource="http://purl.uniprot.org/uniprot/{pdbx:pdbx_db_accession}"/>
|
|---|
| 47 | </xsl:template>
|
|---|
| 48 |
|
|---|
| 49 | <xsl:template match="pdbx:entity_src_gen">
|
|---|
| 50 | <ro:derived-from>
|
|---|
| 51 | <pdb:Gene>
|
|---|
| 52 | <xsl:apply-templates/>
|
|---|
| 53 | </pdb:Gene>
|
|---|
| 54 | </ro:derived-from>
|
|---|
| 55 | <xsl:apply-templates mode="source"/>
|
|---|
| 56 | </xsl:template>
|
|---|
| 57 |
|
|---|
| 58 | <xsl:template match="pdbx:pdbx_description[not(@xsi:nil)]">
|
|---|
| 59 | <rdfs:comment>
|
|---|
| 60 | <xsl:value-of select="."/>
|
|---|
| 61 | </rdfs:comment>
|
|---|
| 62 | </xsl:template>
|
|---|
| 63 |
|
|---|
| 64 | <xsl:template match="pdbx:pdbx_gene_src_gene[not(@xsi:nil)]|pdbx:title[not(@xsi:nil)]">
|
|---|
| 65 | <rdfs:label>
|
|---|
| 66 | <xsl:value-of select="."/>
|
|---|
| 67 | </rdfs:label>
|
|---|
| 68 | </xsl:template>
|
|---|
| 69 |
|
|---|
| 70 | <xsl:template match="pdbx:pdbx_gene_src_organ[not(@xsi:nil)]" mode="source">
|
|---|
| 71 | <ro:derived_from>
|
|---|
| 72 | <pdb:Organ>
|
|---|
| 73 | <rdfs:label>
|
|---|
| 74 | <xsl:value-of select="."/>
|
|---|
| 75 | </rdfs:label>
|
|---|
| 76 | </pdb:Organ>
|
|---|
| 77 | </ro:derived_from>
|
|---|
| 78 | </xsl:template>
|
|---|
| 79 |
|
|---|
| 80 | <xsl:template match="pdbx:pdbx_gene_src_cell_line[not(@xsi:nil)]" mode="source">
|
|---|
| 81 | <ro:derived_from>
|
|---|
| 82 | <pdb:CellLine>
|
|---|
| 83 | <rdfs:label>
|
|---|
| 84 | <xsl:value-of select="."/>
|
|---|
| 85 | </rdfs:label>
|
|---|
| 86 | </pdb:CellLine>
|
|---|
| 87 | </ro:derived_from>
|
|---|
| 88 | </xsl:template>
|
|---|
| 89 |
|
|---|
| 90 | <xsl:template match="pdbx:pdbx_gene_src_cell[not(@xsi:nil)]" mode="source">
|
|---|
| 91 | <ro:derived_from>
|
|---|
| 92 | <pdb:Cell>
|
|---|
| 93 | <rdfs:label>
|
|---|
| 94 | <xsl:value-of select="."/>
|
|---|
| 95 | </rdfs:label>
|
|---|
| 96 | </pdb:Cell>
|
|---|
| 97 | </ro:derived_from>
|
|---|
| 98 | </xsl:template>
|
|---|
| 99 |
|
|---|
| 100 | <!-- Set this as main URI instead
|
|---|
| 101 | <xsl:template match="pdbx:pdbx_database_id_DOI[not(@xsi:nil)]">
|
|---|
| 102 | <rdfs:sameAs rdf:resource="urn:doi:{.}"/>
|
|---|
| 103 | </xsl:template>
|
|---|
| 104 | -->
|
|---|
| 105 |
|
|---|
| 106 | <xsl:template match="pdbx:database_PDB_rev[1]">
|
|---|
| 107 | <dc:created>
|
|---|
| 108 | <xsl:value-of select="pdbx:date_original"/>
|
|---|
| 109 | </dc:created>
|
|---|
| 110 | <xsl:if test="position()=last() and not(pdbx:date/@xsi:nil)">
|
|---|
| 111 | <dc:updated>
|
|---|
| 112 | <xsl:value-of select="pdbx:date"/>
|
|---|
| 113 | </dc:updated>
|
|---|
| 114 | </xsl:if>
|
|---|
| 115 | </xsl:template>
|
|---|
| 116 |
|
|---|
| 117 | <xsl:template match="pdbx:database_PDB_rev[last()]">
|
|---|
| 118 | <dc:updated>
|
|---|
| 119 | <xsl:value-of select="pdbx:date"/>
|
|---|
| 120 | </dc:updated>
|
|---|
| 121 | </xsl:template>
|
|---|
| 122 |
|
|---|
| 123 | <xsl:template match="pdbx:pdbx_gene_ncbi_taxonomy_id">
|
|---|
| 124 | <ro:derived-from>
|
|---|
| 125 | <pdb:Taxon rdf:about="http://www.ncbi.nlm.nih.gov/Taxonomy/{.}">
|
|---|
| 126 | <rdfs:label>
|
|---|
| 127 | <xsl:value-of select="../pdbx:gene_src_scientific_name"/>
|
|---|
| 128 | </rdfs:label>
|
|---|
| 129 | <rdfs:label>
|
|---|
| 130 | <xsl:value-of select="../pdbx:gene_src_common_name"/>
|
|---|
| 131 | </rdfs:label>
|
|---|
| 132 | </pdb:Taxon>
|
|---|
| 133 | </ro:derived-from>
|
|---|
| 134 | </xsl:template>
|
|---|
| 135 |
|
|---|
| 136 | <!-- Should check for not xsi:nil value -->
|
|---|
| 137 | <xsl:template match="pdbx:citation[@id='primary']">
|
|---|
| 138 | <foaf:page>
|
|---|
| 139 | <bibo:AcademicArticle>
|
|---|
| 140 | <xsl:if test="pdbx:pdbx_database_id_DOI[not(@xsi:nil)]">
|
|---|
| 141 | <xsl:attribute name="rdf:about">
|
|---|
| 142 | <xsl:text>urn:doi:</xsl:text>
|
|---|
| 143 | <xsl:value-of select="pdbx:pdbx_database_id_DOI"/>
|
|---|
| 144 | </xsl:attribute>
|
|---|
| 145 | </xsl:if>
|
|---|
| 146 | <rdfs:seeAlso rdf:resource="http://ncbi.nlm.nih.gov/pubmed/{pdbx:pdbx_database_id_PubMed}"/>
|
|---|
| 147 | <xsl:apply-templates/>
|
|---|
| 148 | </bibo:AcademicArticle>
|
|---|
| 149 | </foaf:page>
|
|---|
| 150 | </xsl:template>
|
|---|
| 151 |
|
|---|
| 152 | <xsl:template match="*"/>
|
|---|
| 153 | <xsl:template match="text()"/>
|
|---|
| 154 | <xsl:template match="text()" mode="source"/>
|
|---|
| 155 | </xsl:stylesheet>
|
|---|