本文整理汇总了Java中org.apache.jena.assembler.exceptions.AssemblerException类的典型用法代码示例。如果您正苦于以下问题:Java AssemblerException类的具体用法?Java AssemblerException怎么用?Java AssemblerException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AssemblerException类属于org.apache.jena.assembler.exceptions包,在下文中一共展示了AssemblerException类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: make
import org.apache.jena.assembler.exceptions.AssemblerException; //导入依赖的package包/类
static Dataset make(Resource root) {
// YAML configuration
Lizard.init();
Property pConfiguration = root.getModel().createProperty("urn:lizard:", "configuration") ;
Property pLayout = root.getModel().createProperty("urn:lizard:", "configuration") ;
if ( ! root.hasProperty(pConfiguration) )
throw new AssemblerException(root, "Missing the Lizard config file via "+pConfiguration) ;
if ( ! root.hasProperty(pLayout) )
throw new AssemblerException(root, "Missing the Lizard config file via "+pLayout) ;
String confFile = root.getProperty(pConfiguration).getString() ;
String layoutFile = root.getProperty(pLayout).getString() ;
if ( ! FileOps.exists(confFile) )
throw new AssemblerException(root, "No such file: "+confFile) ;
if ( ! FileOps.exists(layoutFile) )
throw new AssemblerException(root, "No such file: "+confFile) ;
ConfCluster conf = LzConfParserYAML.parseConfFile(confFile,layoutFile) ;
String here = "here" ;
Dataset ds = LzDeploy.deployDataset(conf, here);
return ds ;
}
示例2: fuseki_start
import org.apache.jena.assembler.exceptions.AssemblerException; //导入依赖的package包/类
@Test(expected=AssemblerException.class)
public void fuseki_start() {
// No PatchLogServer running.
//PatchLogServer patchLogServer = patchLogServer();
// AssemblerException -> HttpException -> NoHttpResponseException
FusekiServer server1 = fuseki1();
server1.stop();
RDFConnection conn1 = RDFConnectionFactory.connect("http://localhost:"+F1_PORT+ds1) ;
QueryExecution qExec = conn1.query("ASK{}");
qExec.execAsk();
}
示例3: open
import org.apache.jena.assembler.exceptions.AssemblerException; //导入依赖的package包/类
@Override
public Model open(Assembler a, Resource root, Mode mode)
{
String url = GraphUtils.getStringValue(root, ResourceFactory.createProperty(JENA_NS + "url")) ;
try {
// FIXME: Read more properties. Cache config?
LinkedDataFragmentGraph graph = new LinkedDataFragmentGraph(url);
return ModelFactory.createModelForGraph(graph);
} catch (Exception e) {
e.printStackTrace();
throw new AssemblerException(root, "Error reading LDF url: "+url+" / "+e.toString());
}
}
示例4: open
import org.apache.jena.assembler.exceptions.AssemblerException; //导入依赖的package包/类
@Override
public Object open(Assembler a, Resource root, Mode mode) {
// delta:changes.
if ( ! exactlyOneProperty(root, pDeltaChanges) )
throw new AssemblerException(root, "No destination for changes given") ;
String destURL = getAsStringValue(root, pDeltaChanges);
// Future - multiple outputs.
List<String> xs = Arrays.asList(destURL);
// delta:zone.
if ( ! exactlyOneProperty(root, pDeltaZone) )
throw new AssemblerException(root, "No location for state manangement (zone)") ;
String zoneLocation = getAsStringValue(root, pDeltaZone);
// Name of the patch log.
// delta:patchlog
if ( ! exactlyOneProperty(root, pDeltaPatchLog) )
throw new AssemblerException(root, "No patch log name") ;
String dsName = getAsStringValue(root, pDeltaPatchLog);
// delta:storage
if ( ! exactlyOneProperty(root, pDeltaChanges) )
throw new AssemblerException(root, "No location for state manangement (zone)") ;
String storageTypeStr = getAsStringValue(root, pDeltaStorage);
LocalStorageType storage = LocalStorageType.fromString(storageTypeStr);
if ( storage == null )
throw new AssemblerException(root, "Unrecognized storage type '"+storageTypeStr+"'");
// Build the RDFChanges: URLs to send each patch log entry.
RDFChanges streamChanges = null ;
for ( String dest : xs ) {
FmtLog.info(log, "Destination: '%s'", dest) ;
RDFChanges sc = DeltaLib.destination(dest);
streamChanges = RDFChangesN.multi(streamChanges, sc) ;
}
// Link to log server.
DeltaLink deltaLink = DeltaLinkHTTP.connect(destURL);
// Touch server
Id clientId = Id.create();
deltaLink.register(clientId);
// Create.connect the local copy.
Zone zone = Zone.connect(zoneLocation);
// Local client.
DeltaClient deltaClient = DeltaClient.create(zone, deltaLink);
Id dsRef = setup(deltaClient, dsName, "delta:"+dsName, storage);
DeltaConnection deltaConnection = deltaClient.get(dsRef);
DatasetGraph dsg = deltaConnection.getDatasetGraph();
// This DatasetGraph syncs on transaction so it happens, and assumes, a transaction for any Fuseki operation.
// And someday tap into services to add a "sync before operation" step.
// Poll for changes as well.
// if ( root.hasProperty(pPollForChanges) ) {
// if ( ! exactlyOneProperty(root, pPollForChanges) )
// throw new AssemblerException(root, "Multiple places to poll for chnages") ;
// String source = getStringValue(root, pPollForChanges) ;
// forkUpdateFetcher(source, dsgSub) ;
// }
// Put state into dsg Context "for the record".
Context cxt = dsg.getContext();
cxt.set(symDeltaClient, deltaClient);
cxt.set(symDeltaConnection, deltaConnection);
cxt.set(symDeltaZone, zone);
return DatasetFactory.wrap(dsg);
}