Skip to content

Commit

Permalink
Namespace changes
Browse files Browse the repository at this point in the history
XSLT cleanup
  • Loading branch information
Martynas committed Sep 14, 2016
1 parent f458255 commit cd5663c
Show file tree
Hide file tree
Showing 32 changed files with 520 additions and 524 deletions.
Expand Up @@ -151,16 +151,16 @@ public Templates getTemplates(ServletConfig servletConfig) throws TransformerCon
URI stylesheetURI = getStylesheetURI(servletConfig, AC.stylesheet);
if (stylesheetURI == null)
{
if (log.isErrorEnabled()) log.error("XSLT stylesheet (gc:stylesheet) not configured");
throw new ConfigurationException("XSLT stylesheet (gc:stylesheet) not configured");
if (log.isErrorEnabled()) log.error("XSLT stylesheet (ac:stylesheet) not configured");
throw new ConfigurationException("XSLT stylesheet (ac:stylesheet) not configured");
}

return getTemplates(stylesheetURI, getTemplatesCache());
}

/**
* Returns configured XSLT stylesheet resource.
* Uses <code>gc:stylesheet</code> servlet parameter value from web.xml as stylesheet location.
* Uses <code>ac:stylesheet</code> servlet parameter value from web.xml as stylesheet location.
*
* @param servletConfig
* @param property
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/atomgraph/client/vocabulary/AC.java
Expand Up @@ -37,7 +37,7 @@ public final class AC
private static OntModel m_model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null);

/** <p>The namespace of the vocabulary as a string</p> */
public static final String NS = "http://atomgraph.com/client/ns#";
public static final String NS = "http://atomgraph.com/ns/client#";

/** <p>The namespace of the vocabulary as a string</p>
* @see #NS */
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/atomgraph/client/vocabulary/LDT.java
Expand Up @@ -54,7 +54,9 @@ public static String getURI()
public static final OntClass TemplateCall = m_model.createClass( NS + "TemplateCall" );

public static final OntClass Argument = m_model.createClass( NS + "Argument" );


public static final ObjectProperty baseUri = m_model.createObjectProperty( NS + "baseUri" );

public static final ObjectProperty ontology = m_model.createObjectProperty( NS + "ontology" );

public static final AnnotationProperty template = m_model.createAnnotationProperty( NS + "template" );
Expand Down
Expand Up @@ -278,9 +278,9 @@ public XSLTBuilder getXSLTBuilder(XSLTBuilder bld, MultivaluedMap<String, Object
if (typeHref != null)
bld.parameter("{" + RDF.type.getNameSpace() + "}" + RDF.type.getLocalName(), typeHref);

URI baseHref = getLinkHref(headerMap, "Link", A.baseUri.getURI()); // LDT.baseUri?
URI baseHref = getLinkHref(headerMap, "Link", LDT.baseUri.getURI()); // LDT.baseUri?
if (baseHref != null)
bld.parameter("{" + A.baseUri.getNameSpace() + "}" + A.baseUri.getLocalName(), baseHref);
bld.parameter("{" + LDT.baseUri.getNameSpace() + "}" + LDT.baseUri.getLocalName(), baseHref);

URI ontologyHref = getLinkHref(headerMap, "Link", LDT.ontology.getURI());
if (ontologyHref != null)
Expand Down Expand Up @@ -430,7 +430,7 @@ public MediaType getCustomMediaType(UriInfo uriInfo)
Resource mode = null;

if (uriInfo.getQueryParameters().getFirst(AC.forClass.getLocalName()) != null)
mode = AC.EditMode; // this could be solved using a dummy gc:ConstructMode instead
mode = AC.EditMode; // this could be solved using a dummy ac:ConstructMode instead
else
{
if (uriInfo.getQueryParameters().getFirst(AC.mode.getLocalName()) != null)
Expand Down
@@ -1,4 +1,4 @@
@base <http://atomgraph.com/client/ns> .
@base <http://atomgraph.com/ns/client> .

# @prefix : <#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/com/atomgraph/client/th.ttl
Expand Up @@ -47,7 +47,7 @@

# QUERIES

<#DescribeWithTopic> a sp:Describe, sp:Query ; # gp:Query ;
<#DescribeWithTopic> a sp:Describe, sp:Query ; # ldt:Query ;
sp:text """PREFIX foaf: <http://xmlns.com/foaf/0.1/>
DESCRIBE ?this ?primaryTopic
Expand Down
15 changes: 10 additions & 5 deletions src/main/resources/prefix-mapping.n3
Expand Up @@ -2,11 +2,7 @@

[] lm:mapping

[ lm:name "http://atomgraph.com/client/ns#" ; lm:altName "com/atomgraph/client/gc.ttl" ] ,
[ lm:name "http://www.w3.org/ns/ldt#" ; lm:altName "com/atomgraph/client/ldt.ttl" ] ,
[ lm:name "http://www.w3.org/ns/ldt/core#" ; lm:altName "com/atomgraph/client/core.ttl" ] ,
[ lm:name "http://www.w3.org/ns/ldt/document-hierarchy#" ; lm:altName "com/atomgraph/client/dh.ttl" ] ,
[ lm:name "http://www.w3.org/ns/ldt/topic-hierarchy#" ; lm:altName "com/atomgraph/client/th.ttl" ] ,
[ lm:name "http://atomgraph.com/ns/client#" ; lm:altName "com/atomgraph/client/ns.ttl" ] ,
[ lm:name "http://rdfs.org/sioc/ns#" ; lm:altName "com/atomgraph/client/sioc.owl" ] ,
[ lm:name "http://rdfs.org/ns/void#" ; lm:altName "com/atomgraph/client/void.owl" ] ,
[ lm:name "http://www.w3.org/1999/02/22-rdf-syntax-ns#" ; lm:altName "com/atomgraph/client/rdf.owl" ] ,
Expand All @@ -17,6 +13,10 @@
[ lm:name "http://www.w3.org/2006/time#" ; lm:altName "com/atomgraph/client/time.owl" ] ,
[ lm:name "http://www.w3.org/2011/http#" ; lm:altName "com/atomgraph/client/http.owl" ] ,
[ lm:name "http://www.w3.org/2011/http-statusCodes#" ; lm:altName "com/atomgraph/client/http-statusCodes.rdf" ] ,
[ lm:name "http://www.w3.org/ns/ldt#" ; lm:altName "com/atomgraph/client/ldt.ttl" ] ,
[ lm:name "http://www.w3.org/ns/ldt/core#" ; lm:altName "com/atomgraph/client/core.ttl" ] ,
[ lm:name "http://www.w3.org/ns/ldt/document-hierarchy#" ; lm:altName "com/atomgraph/client/dh.ttl" ] ,
[ lm:name "http://www.w3.org/ns/ldt/topic-hierarchy#" ; lm:altName "com/atomgraph/client/th.ttl" ] ,
[ lm:name "http://www.w3.org/ns/sparql-service-description#" ; lm:altName "com/atomgraph/client/sparql-service.owl" ] ,
[ lm:name "http://purl.org/dc/elements/1.1/" ; lm:altName "com/atomgraph/client/dcelements.rdf" ] ,
[ lm:name "http://purl.org/dc/terms/" ; lm:altName "com/atomgraph/client/dcterms.rdf" ] ,
Expand All @@ -26,6 +26,7 @@
[ lm:name "http://graph.facebook.com/schema/user#" ; lm:altName "com/atomgraph/client/gfb-user.owl" ] ,
[ lm:name "http://usefulinc.com/ns/doap#" ; lm:altName "com/atomgraph/client/doap.owl" ] ,

[ lm:prefix "http://atomgraph.com/ns/client" ; lm:altName "com/atomgraph/client/ns.ttl" ] ,
[ lm:prefix "http://rdfs.org/sioc/ns" ; lm:altName "com/atomgraph/client/sioc.owl" ] ,
[ lm:prefix "http://rdfs.org/ns/void" ; lm:altName "com/atomgraph/client/void.owl" ] ,
[ lm:prefix "http://www.w3.org/1999/02/22-rdf-syntax-ns" ; lm:altName "com/atomgraph/client/rdf.owl" ] ,
Expand All @@ -36,6 +37,10 @@
[ lm:prefix "http://www.w3.org/2006/time" ; lm:altName "com/atomgraph/client/time.owl" ] ,
[ lm:prefix "http://www.w3.org/2011/http" ; lm:altName "com/atomgraph/client/http.owl" ] ,
[ lm:prefix "http://www.w3.org/2011/http-statusCodes" ; lm:altName "com/atomgraph/client/http-statusCodes.rdf" ] ,
[ lm:prefix "http://www.w3.org/ns/ldt" ; lm:altName "com/atomgraph/client/ldt.ttl" ] ,
[ lm:prefix "http://www.w3.org/ns/ldt/core" ; lm:altName "com/atomgraph/client/core.ttl" ] ,
[ lm:prefix "http://www.w3.org/ns/ldt/document-hierarchy" ; lm:altName "com/atomgraph/client/dh.ttl" ] ,
[ lm:prefix "http://www.w3.org/ns/ldt/topic-hierarchy" ; lm:altName "com/atomgraph/client/th.ttl" ] ,
[ lm:prefix "http://www.w3.org/ns/sparql-service-description" ; lm:altName "com/atomgraph/client/sparql-service.owl" ] ,
[ lm:prefix "http://purl.org/dc/elements/1.1/" ; lm:altName "com/atomgraph/client/dcelements.rdf" ] ,
[ lm:prefix "http://purl.org/dc/terms/" ; lm:altName "com/atomgraph/client/dcterms.rdf" ] ,
Expand Down
12 changes: 6 additions & 6 deletions src/main/webapp/WEB-INF/web.xml
Expand Up @@ -26,27 +26,27 @@
<param-value>http://graphity.dydra.com/graphity/client/sparql</param-value>
</init-param>
<init-param>
<param-name>http://atomgraph.com/core/ns#graphStore</param-name>
<param-name>http://atomgraph.com/ns/core#graphStore</param-name>
<param-value>http://graphity.dydra.com/graphity/client/service</param-value>
</init-param>
<init-param>
<param-name>http://atomgraph.com/client/ns#stylesheet</param-name>
<param-name>http://atomgraph.com/ns/client#stylesheet</param-name>
<param-value>static/com/atomgraph/client/xsl/bootstrap/2.3.2/core.xsl</param-value>
</init-param>
<init-param>
<param-name>http://atomgraph.com/core/ns#resultLimit</param-name>
<param-name>http://atomgraph.com/ns/core#resultLimit</param-name>
<param-value>100</param-value>
</init-param>
<init-param>
<param-name>http://atomgraph.com/client/ns#cacheStylesheet</param-name>
<param-name>http://atomgraph.com/ns/client#cacheStylesheet</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>http://atomgraph.com/core/ns#cacheModelLoads</param-name>
<param-name>http://atomgraph.com/ns/core#cacheModelLoads</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>http://atomgraph.com/client/ns#resolvingUncached</param-name>
<param-name>http://atomgraph.com/ns/client#resolvingUncached</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
Expand Down

0 comments on commit cd5663c

Please sign in to comment.