views.common.vsl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fcrepo-http-api Show documentation
Show all versions of fcrepo-http-api Show documentation
The Fedora Commons repository HTTP API: Provides a RESTful HTTP API to interact with the Fedora Commons repository.
The newest version!
#* @vtlvariable name="quad" type="org.apache.jena.sparql.core.Quad" *#
#* @vtlvariable name="rdf" type="org.apache.jena.graph.Graph" *#
#* @vtlvariable name="model" type="org.apache.jena.rdf.model.Model" *#
#* @vtlvariable name="triple" type="org.apache.jena.graph.Triple" *#
#macro( triples $sub )
#set ($last_quad = false)
#foreach($triple in $helpers.getSortedTriples($model, $rdf.find($sub, $nodeany, $nodeany)))
#if( $helpers.isManagedProperty($triple.getPredicate()) )
#set ($prop_status = ' class="text-info" title="managed predicate"')
#else
#set ($prop_status = "")
#end
#if($last_quad == false || !$last_quad.getPredicate().equals($triple.getPredicate()))
-
#if($last_quad == false || !$last_quad.getPredicate().getNameSpace().equals($triple.getPredicate().getNameSpace()))
$helpers.getNamespacePrefix($model, $triple.getPredicate().getNameSpace(), false)
#else
$helpers.getNamespacePrefix($model, $triple.getPredicate().getNameSpace(), true)
#end
$triple.getPredicate().getLocalName()
#end
-
#if($triple.getObject().isURI() && $triple.getObject().getURI().startsWith("http"))
$esc.html($triple.getObject())
#elseif ($triple.getObject().isLiteral())
$esc.html($triple.getObject().getLiteral().getLexicalForm())
#else
$esc.html($triple.getObject())
#end
#set ($last_quad = $triple)
#end
#end
© 2015 - 2025 Weber Informatics LLC | Privacy Policy