public class LDPathHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static at.newmedialab.ldpath.model.fields.FieldMapping<Double,Object> |
RESULT_SCORE_MAPPING
LDPath
FieldMapping for the RdfResourceEnum.resultScore
property used for the score of query results |
| Constructor and Description |
|---|
LDPathHelper() |
| Modifier and Type | Method and Description |
|---|---|
static Map<String,String> |
getLDPathParseExceptionMessage(at.newmedialab.ldpath.exception.LDPathParseException e)
Utility that gets the messages of the parsing error.
|
static javax.ws.rs.core.Response |
handleLDPathRequest(org.apache.stanbol.commons.web.base.resource.BaseStanbolResource resource,
at.newmedialab.ldpath.api.backend.RDFBackend<Object> backend,
String ldpath,
Set<String> contexts,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.ServletContext servletContext)
Processes LDPath requests as supported by the
SiteManagerRootResource,
ReferencedSiteRootResource, EntityhubRootResource. |
static at.newmedialab.ldpath.model.programs.Program<Object> |
prepareQueryLDPathProgram(String ldpathProgram,
Set<String> selectedFields,
org.apache.stanbol.entityhub.ldpath.backend.AbstractBackend backend,
org.apache.stanbol.entityhub.ldpath.EntityhubLDPath ldPath) |
static Collection<org.apache.stanbol.entityhub.servicesapi.model.Representation> |
transformQueryResults(Iterator<org.apache.stanbol.entityhub.servicesapi.model.Representation> resultIt,
at.newmedialab.ldpath.model.programs.Program<Object> program,
Set<String> selectedFields,
org.apache.stanbol.entityhub.ldpath.EntityhubLDPath ldPath,
org.apache.stanbol.entityhub.ldpath.backend.AbstractBackend backend,
org.apache.stanbol.entityhub.servicesapi.model.ValueFactory vf)
Transform the results of a query
|
public static Map<String,String> getLDPathParseExceptionMessage(at.newmedialab.ldpath.exception.LDPathParseException e)
Throwable.getCause()s. The toString method of the returned map
will print the "exception: message" in the correct order.e - the exceptionpublic static javax.ws.rs.core.Response handleLDPathRequest(org.apache.stanbol.commons.web.base.resource.BaseStanbolResource resource,
at.newmedialab.ldpath.api.backend.RDFBackend<Object> backend,
String ldpath,
Set<String> contexts,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.ServletContext servletContext)
SiteManagerRootResource,
ReferencedSiteRootResource, EntityhubRootResource.resource - The resource used as context when sending RESTful Service API
Viewable as response entity.backend - The RDFBackend implementationldpath - the parsed LDPath programcontexts - the Entities to execute the LDPath programheaders - the parsed HTTP headers (used to determine the accepted
content type for the responseservletContext - The Servlet context needed for CORS supportResponse.Status.BAD_REQUEST or Response.Status.OK.public static Collection<org.apache.stanbol.entityhub.servicesapi.model.Representation> transformQueryResults(Iterator<org.apache.stanbol.entityhub.servicesapi.model.Representation> resultIt, at.newmedialab.ldpath.model.programs.Program<Object> program, Set<String> selectedFields, org.apache.stanbol.entityhub.ldpath.EntityhubLDPath ldPath, org.apache.stanbol.entityhub.ldpath.backend.AbstractBackend backend, org.apache.stanbol.entityhub.servicesapi.model.ValueFactory vf)
resultIt - The Iterator over the resultsprogram - the LDPath Program to execute on the resultsselectedFields - additional selected fields of the queryldPath - the Entityhub LDPathbackend - the AbstractBackend mainly used to
add representations of
the query to the local cachevf - the ValueFactory used create References for the
String ids of the Representation in
the query resultspublic static at.newmedialab.ldpath.model.programs.Program<Object> prepareQueryLDPathProgram(String ldpathProgram, Set<String> selectedFields, org.apache.stanbol.entityhub.ldpath.backend.AbstractBackend backend, org.apache.stanbol.entityhub.ldpath.EntityhubLDPath ldPath) throws at.newmedialab.ldpath.exception.LDPathParseException
ldpathProgram - the LDPath program as stringselectedFields - the selected fields of the querybackend - the RDFBackend (only needed for logging)ldPath - the LDPath used to parse the program.at.newmedialab.ldpath.exception.LDPathParseException - if the parsed LDPath program string is not
validIllegalStateException - if the fields selected by the LDPath
program conflict with the fields selected by the query.Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.