当前位置: 首页>>代码示例>>Java>>正文


Java AssemblerException类代码示例

本文整理汇总了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 ;
}
 
开发者ID:afs,项目名称:lizard,代码行数:25,代码来源:AssemblerYaml.java

示例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();
}
 
开发者ID:afs,项目名称:rdf-delta,代码行数:14,代码来源:TestDeltaFusekiBad.java

示例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());
    }
}
 
开发者ID:LinkedDataFragments,项目名称:Client.Java,代码行数:15,代码来源:LinkedDataFragmentsGraphAssembler.java

示例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);
    }
 
开发者ID:afs,项目名称:rdf-delta,代码行数:71,代码来源:DeltaAssembler.java


注:本文中的org.apache.jena.assembler.exceptions.AssemblerException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。