Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add indexing: namespace for user-defined values in fedora
- Update HTML header rendering to make it consistent with owl2html Resolves: https://jira.duraspace.org/browse/FCREPO-1285
- Loading branch information
Showing
7 changed files
with
234 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
<index title="Fedora Ontologies"> | ||
<page id="rels-ext"/> | ||
<page id="repository"/> | ||
<page id="rest-api"/> | ||
<page id="indexing"/> | ||
</index> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" | ||
xmlns:dcterms="http://purl.org/dc/terms/" | ||
xmlns:owl="http://www.w3.org/2002/07/owl#" | ||
xmlns:xsd="http://www.w3.org/2001/XMLSchema#" | ||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> | ||
<xsl:output method="html"/> | ||
<xsl:template match="/index"> | ||
<html> | ||
<head> | ||
<title><xsl:value-of select="@title"/></title> | ||
<style> | ||
h1 { font-size: large; } | ||
body { font-family: sans-serif; } | ||
</style> | ||
</head> | ||
<body> | ||
<h1><xsl:value-of select="@title"/></h1> | ||
<ul> | ||
<xsl:for-each select="page"> | ||
<xsl:variable name="page_id" select="@id"/> | ||
<xsl:for-each select="document(concat($page_id,'.rdf'))"> | ||
<xsl:choose> | ||
<xsl:when test="rdf:RDF/owl:Ontology/rdfs:label"> | ||
<li> | ||
<a href="{$page_id}/"><xsl:value-of select="rdf:RDF/owl:Ontology/rdfs:label"/></a> | ||
</li> | ||
</xsl:when> | ||
<xsl:when test="rdf:RDF/rdf:Description[1]/dcterms:title"> | ||
<a href="{$page_id}/"><xsl:value-of select="rdf:RDF/rdf:Description[1]/dcterms:title"/></a> | ||
</xsl:when> | ||
</xsl:choose> | ||
</xsl:for-each> | ||
</xsl:for-each> | ||
</ul> | ||
</body> | ||
</html> | ||
</xsl:template> | ||
</xsl:stylesheet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0"?> | ||
<?xml-stylesheet type="text/xsl" href="rdfs2html.xsl"?> | ||
<rdf:RDF | ||
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" | ||
xmlns:xsd="http://www.w3.org/2001/XMLSchema#" | ||
xmlns:dcterms="http://purl.org/dc/terms/" | ||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> | ||
|
||
<rdf:Description rdf:about="http://fedora.info/definitions/v4/indexing#"> | ||
<dcterms:title xml:lang="en">Fedora Commons Indexing Ontology</dcterms:title> | ||
<dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-01-23</dcterms:modified> | ||
<dcterms:publisher rdf:resource="http://fedorarepository.org/"/> | ||
<rdfs:seeAlso rdf:resource="https://wiki.duraspace.org/display/FEDORA4x/External+Search"/> | ||
<rdfs:comment xml:lang="en">Ontology for indexing configuration in Fedora repositories.</rdfs:comment> | ||
</rdf:Description> | ||
|
||
<rdf:Property rdf:about="http://fedora.info/definitions/v4/indexing#hasIndexingTransformation"> | ||
<rdfs:label xml:lang="en">has indexing transformation</rdfs:label> | ||
<rdfs:comment xml:lang="en">Specifies an indexing transformation</rdfs:comment> | ||
<rdfs:domain rdf:resource="http://fedora.info/definitions/v4/indexing#Indexable"/> | ||
<rdfs:isDefinedBy rdf:resource="http://fedora.info/definitions/v4/indexing#"/> | ||
</rdf:Property> | ||
|
||
<rdfs:Class rdf:about="http://fedora.info/definitions/v4/indexing#Indexable"> | ||
<rdfs:label xml:lang="en">indexable resource</rdfs:label> | ||
<rdfs:comment xml:lang="en">A resource that has been marked as indexable.</rdfs:comment> | ||
<rdfs:subClassOf rdf:resource="http://fedora.info/definitions/v4/repository#Resource"/> | ||
<rdfs:isDefinedBy rdf:resource="http://fedora.info/definitions/v4/indexing#"/> | ||
</rdfs:Class> | ||
|
||
</rdf:RDF> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" | ||
xmlns:owl="http://www.w3.org/2002/07/owl#" | ||
xmlns:xsd="http://www.w3.org/2001/XMLSchema#" | ||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
xmlns:dcterms="http://purl.org/dc/terms/"> | ||
<xsl:output method="html"/> | ||
<xsl:variable name="about" select="/rdf:RDF/rdf:Description[1]/@rdf:about"/> | ||
<xsl:variable name="title" select="/rdf:RDF/rdf:Description[1]/dcterms:title"/> | ||
<xsl:variable name="comment" select="/rdf:RDF/rdf:Description[1]/rdfs:comment"/> | ||
<xsl:variable name="modified" select="/rdf:RDF/rdf:Description[1]/dcterms:modified"/> | ||
<xsl:variable name="publisher" select="/rdf:RDF/rdf:Description[1]/dcterms:publisher/@rdf:resource"/> | ||
<xsl:variable name="seeAlso" select="/rdf:RDF/rdf:Description[1]/rdfs:seeAlso/@rdf:resource"/> | ||
|
||
|
||
<xsl:template match="/"> | ||
<html> | ||
<head> | ||
<title><xsl:value-of select="$title"/></title> | ||
<style> | ||
h4 { margin-bottom: 0.25em; } | ||
body { font-family: sans-serif; } | ||
.about { font-family: monospace; margin-left: 1em; } | ||
.label { margin-left: 1em; font-style:italic; } | ||
.comment { margin-left: 1em; } | ||
.property { margin-left: 1em; } | ||
.modified { margin-left: 1em; } | ||
.published { margin-left: 1em; } | ||
.seealso { margin-left: 1em; } | ||
</style> | ||
</head> | ||
<body> | ||
<h1><xsl:value-of select="$title"/></h1> | ||
<div class="about"><xsl:value-of select="$about"/></div> | ||
<div class="comment"><xsl:value-of select="$comment"/></div> | ||
<div class="modified">Modified: <xsl:value-of select="$modified"/></div> | ||
<div class="published">Published by: <a href="{$publisher}"><xsl:value-of select="$publisher"/></a></div> | ||
<xsl:if test="$seeAlso != ''"> | ||
<div class="seealso">See Also: <a href="{$seeAlso}"><xsl:value-of select="$seeAlso"/></a></div> | ||
</xsl:if> | ||
|
||
<!-- table of contents --> | ||
<div class="table-of-contents"> | ||
<h2>Table of Contents</h2> | ||
<xsl:for-each select="/rdf:RDF/rdfs:Class"> | ||
<xsl:sort select="@rdf:about"/> | ||
<xsl:if test="position() = 1"><h3>Classes</h3></xsl:if> | ||
<xsl:call-template name="toc-entry"/> | ||
</xsl:for-each> | ||
<xsl:for-each select="/rdf:RDF/rdf:Property"> | ||
<xsl:sort select="@rdf:about"/> | ||
<xsl:if test="position() = 1"><h3>Properties</h3></xsl:if> | ||
<xsl:call-template name="toc-entry"/> | ||
</xsl:for-each> | ||
</div> | ||
|
||
<!-- class list --> | ||
<div class="contents"> | ||
<h2>Entity Definitions</h2> | ||
<xsl:for-each select="/rdf:RDF/rdfs:Class"> | ||
<xsl:sort select="@rdf:about"/> | ||
<xsl:if test="position() = 1"><h3>Classes</h3></xsl:if> | ||
<xsl:call-template name="main-entry"/> | ||
</xsl:for-each> | ||
|
||
<!-- properties list --> | ||
<xsl:for-each select="/rdf:RDF/rdf:Property"> | ||
<xsl:sort select="@rdf:about"/> | ||
<xsl:if test="position() = 1"><h3>Properties</h3></xsl:if> | ||
<xsl:call-template name="main-entry"/> | ||
</xsl:for-each> | ||
</div> | ||
</body> | ||
</html> | ||
</xsl:template> | ||
<xsl:template name="display-uri"> | ||
<xsl:param name="label"/> | ||
<xsl:param name="uri"/> | ||
<xsl:variable name="name"> | ||
<xsl:choose> | ||
<xsl:when test="/*/namespace::*[starts-with($uri,.)]"> | ||
<xsl:for-each select="/*/namespace::*"> | ||
<xsl:if test="starts-with($uri,.)"> | ||
<xsl:value-of select="name()"/>:<xsl:value-of select="substring-after($uri,.)"/> | ||
</xsl:if> | ||
</xsl:for-each> | ||
</xsl:when> | ||
<xsl:otherwise><xsl:value-of select="$uri"/></xsl:otherwise> | ||
</xsl:choose> | ||
</xsl:variable> | ||
<xsl:if test="$uri != ''"> | ||
<li><xsl:value-of select="$label"/><xsl:text>: </xsl:text> | ||
<a href="$uri"><xsl:value-of select="$name"/></a> | ||
</li> | ||
</xsl:if> | ||
</xsl:template> | ||
<xsl:template name="toc-entry"> | ||
<xsl:variable name="id"> | ||
<xsl:value-of select="substring-after(@rdf:about,$about)"/> | ||
</xsl:variable> | ||
<xsl:if test="$id != ''"> | ||
<a href="#{$id}"><xsl:value-of select="$id"/></a> | ||
<xsl:text> </xsl:text> | ||
</xsl:if> | ||
</xsl:template> | ||
<xsl:template name="main-entry"> | ||
<xsl:variable name="id"> | ||
<xsl:value-of select="substring-after(@rdf:about,$about)"/> | ||
</xsl:variable> | ||
<xsl:if test="$id != ''"> | ||
<h4 id="{$id}"><xsl:value-of select="$id"/></h4> | ||
<ul> | ||
<li>Label: <xsl:value-of select="rdfs:label"/></li> | ||
<xsl:if test="rdfs:comment != ''"> | ||
<li>Comment: <xsl:value-of select="rdfs:comment"/></li> | ||
</xsl:if> | ||
<xsl:if test="rdfs:subClassOf/@rdf:resource"> | ||
<xsl:call-template name="display-uri"> | ||
<xsl:with-param name="label">Subclass of</xsl:with-param> | ||
<xsl:with-param name="uri" select="rdfs:subClassOf/@rdf:resource"/> | ||
</xsl:call-template> | ||
</xsl:if> | ||
<xsl:if test="rdfs:subPropertyOf/@rdf:resource"> | ||
<xsl:call-template name="display-uri"> | ||
<xsl:with-param name="label">Subproperty of</xsl:with-param> | ||
<xsl:with-param name="uri" select="rdfs:subPropertyOf/@rdf:resource"/> | ||
</xsl:call-template> | ||
</xsl:if> | ||
<xsl:if test="rdfs:domain/@rdf:resource"> | ||
<xsl:call-template name="display-uri"> | ||
<xsl:with-param name="label">Domain</xsl:with-param> | ||
<xsl:with-param name="uri" select="rdfs:domain/@rdf:resource"/> | ||
</xsl:call-template> | ||
</xsl:if> | ||
<xsl:if test="rdfs:range/@rdf:resource"> | ||
<xsl:call-template name="display-uri"> | ||
<xsl:with-param name="label">Range</xsl:with-param> | ||
<xsl:with-param name="uri" select="rdfs:range/@rdf:resource"/> | ||
</xsl:call-template> | ||
</xsl:if> | ||
</ul> | ||
</xsl:if> | ||
</xsl:template> | ||
</xsl:stylesheet> |