• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java RepositoryConfigException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.openrdf.repository.config.RepositoryConfigException的典型用法代码示例。如果您正苦于以下问题:Java RepositoryConfigException类的具体用法?Java RepositoryConfigException怎么用?Java RepositoryConfigException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RepositoryConfigException类属于org.openrdf.repository.config包,在下文中一共展示了RepositoryConfigException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getRepository

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
@Override
/**
 * instantiate and return repository
 *
 */
public Repository getRepository(RepositoryImplConfig config) throws RepositoryConfigException {
    MarkLogicRepository repo = null;
    MarkLogicRepositoryConfig cfg = (MarkLogicRepositoryConfig) config;
    if (cfg.getHost() != null && cfg.getPort() != 0) {
        // init with MarkLogicRepositoryConfig
        repo = new MarkLogicRepository(cfg.getHost(),cfg.getPort(),cfg.getUser(),cfg.getPassword(),cfg.getAuth());
    } else if (cfg.getHost() == null) {
        // init with queryEndpoint as connection string
        try {
            repo = new MarkLogicRepository(new URL(cfg.getQueryEndpointUrl()));
        } catch (MalformedURLException e) {
            logger.debug(e.getMessage());
            throw new RepositoryConfigException(e.getMessage());
        }
    }else{
        throw new RepositoryConfigException("Invalid configuration class: " + config.getClass());
    }
    return repo;
}
 
开发者ID:marklogic,项目名称:marklogic-sesame,代码行数:25,代码来源:MarkLogicRepositoryFactory.java


示例2: parse

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
@Override
/**
 * parse graph representation of config
 *
    * @Note - Graph is deprecating soon (in Sesame) to be replaced by Model
 */
public void parse(Graph graph, Resource implNode)
		throws RepositoryConfigException {
	super.parse(graph, implNode);

	try {
		URI uri = GraphUtil.getOptionalObjectURI(graph, implNode, QUERY_ENDPOINT);
		if (uri != null) {
			setQueryEndpointUrl(uri.stringValue());
		}

		uri = GraphUtil.getOptionalObjectURI(graph, implNode, UPDATE_ENDPOINT);
		if (uri != null) {
			setUpdateEndpointUrl(uri.stringValue());
		}
	} catch (GraphUtilException e) {
		throw new RepositoryConfigException(e.getMessage(), e);
	}
}
 
开发者ID:marklogic,项目名称:marklogic-sesame,代码行数:25,代码来源:MarkLogicRepositoryConfig.java


示例3: setRepository

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
/**
 * Configures the Repository (Connector for local/remote SPARQL repository) to use in Anno4j.
 *
 * @param repository Repository to use in Anno4j.
 * @param conceptJars URLs of JAR-files that are scanned for concepts.
 * @param behaviourJars URLs of JAR-files that are scanned for behaviours.
 * @throws RepositoryException
 * @throws RepositoryConfigException
 */
public void setRepository(Repository repository, Set<URL> conceptJars, Set<URL> behaviourJars) throws RepositoryException, RepositoryConfigException {
    this.repository = repository;
    // update alibaba wrapper

    ObjectRepositoryFactory factory = new ObjectRepositoryFactory();
    ObjectRepositoryConfig config = factory.getConfig();

    for(URL conceptJar : conceptJars) {
        config.addConceptJar(conceptJar);
    }
    for(URL behaviourJar : behaviourJars) {
        config.addBehaviourJar(behaviourJar);
    }

    if(partialClasses != null) {
        for(Class<?> clazz : this.partialClasses){
            if (!clazz.getSimpleName().endsWith("AbstractClass")) {
                config.addBehaviour(clazz);
            }
        }
    }

    this.objectRepository = new ObjectRepositoryFactory().createRepository(config, repository);
    this.objectRepository.setIdGenerator(idGenerator);
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:35,代码来源:Anno4j.java


示例4: ObjectParser

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
/**
 * Basic constructor, which sets up all the necessary repositories.
 *
 * @throws RepositoryException
 * @throws RepositoryConfigException
 */
public ObjectParser() throws RepositoryException, RepositoryConfigException {
    this.anno4j = new Anno4j();
    URIImpl[] motivations = new URIImpl[]{
            new URIImpl(OADM.MOTIVATION_BOOKMARKING),
            new URIImpl(OADM.MOTIVATION_CLASSIFYING),
            new URIImpl(OADM.MOTIVATION_COMMENTING),
            new URIImpl(OADM.MOTIVATION_DESCRIBING),
            new URIImpl(OADM.MOTIVATION_EDITING),
            new URIImpl(OADM.MOTIVATION_HIGHLIGHTING),
            new URIImpl(OADM.MOTIVATION_IDENTIFYING),
            new URIImpl(OADM.MOTIVATION_LINKING),
            new URIImpl(OADM.MOTIVATION_MODERATING),
            new URIImpl(OADM.MOTIVATION_QUESTIONING),
            new URIImpl(OADM.MOTIVATION_REPLYING),
            new URIImpl(OADM.MOTIVATION_TAGGING)
    };

    URIImpl obj = new URIImpl(OADM.MOTIVATION);
    URIImpl pre = new URIImpl(RDF.TYPE);

    for (URIImpl sub : motivations) {
        StatementImpl statement = new StatementImpl(sub, pre, obj);
        anno4j.getRepository().getConnection().add(statement);
    }
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:32,代码来源:ObjectParser.java


示例5: resetQueryService

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
@Before
public void resetQueryService() throws RepositoryConfigException, RepositoryException, InstantiationException, IllegalAccessException {
    this.anno4j = new Anno4j();
    queryService = anno4j.createQueryService();
    queryService.addPrefix("ex", "http://www.example.com/schema#");

    // Persisting some data
    Annotation annotation =  anno4j.createObject(Annotation.class);
    HashSet<Target> targets = new HashSet<>();
    SpecificResource specificResource =  anno4j.createObject(SpecificResource.class);
    SpecificResource resource2 =  anno4j.createObject(SpecificResource.class);
    resource2.setSelector( anno4j.createObject(SvgSelector.class));
    specificResource.setSelector(anno4j.createObject(FragmentSelector.class));
    targets.add(specificResource);
    targets.add(resource2);
    annotation.setTargets(targets);

}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:19,代码来源:QueryServiceTest.java


示例6: oneOrMoreTest

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
@Test
/**
 * Test method for OneOrMorePath
 *
 * @see <a href="http://www.w3.org/TR/sparql11-query/#pp-language">http://www.w3.org/TR/sparql11-query/#pp-language</a>
 */
public void oneOrMoreTest() throws RepositoryException, QueryEvaluationException, MalformedQueryException, ParseException, RepositoryConfigException, IllegalAccessException, InstantiationException {
    List<Annotation> annotations = queryService
            .addCriteria("(oa:hasTarget)+")
            .execute();
    assertEquals(0, annotations.size());

    super.setupUpQueryTest();

    annotations = queryService
            .addCriteria("(oa:hasBody)+")
            .addCriteria("oa:hasBody/ex:recursiveBodyValue", "Another Testing Value")
            .execute();
    assertEquals(1, annotations.size());
    assertEquals("Another Testing Value", ((RecursiveBody) annotations.get(0).getBodies().iterator().next()).getValue());
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:22,代码来源:RecursivePathTest.java


示例7: zeroOrMoreTest

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
@Test
/**
 * Test method for ZeroOrMorePath.
 *
 * @see <a href="http://www.w3.org/TR/sparql11-query/#pp-language">http://www.w3.org/TR/sparql11-query/#pp-language</a>
 */
public void zeroOrMoreTest() throws RepositoryException, QueryEvaluationException, MalformedQueryException, ParseException, RepositoryConfigException, IllegalAccessException, InstantiationException {
    List<Annotation> annotations = queryService.addCriteria("(oa:hasBody/ex:recursiveBodyValue)*", "Some Testing Value").execute();
    assertEquals(1, annotations.size());
    assertEquals("Some Testing Value", ((RecursiveBody) annotations.get(0).getBodies().iterator().next()).getValue());

    super.setupUpQueryTest();

    annotations = queryService.addCriteria("(oa:hasTarget)*").execute();
    assertEquals(2, annotations.size());
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:17,代码来源:RecursivePathTest.java


示例8: testJSONLD

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
@Test
public void testJSONLD() throws UpdateExecutionException {

    try {
        URL url = new URL("http://example.com/");

        ObjectParser objectParser = new ObjectParser();
        List<Annotation> annotations = objectParser.parse(JSONLD, url, RDFFormat.JSONLD, true);

        for(Annotation anno : annotations) {
            System.out.println(anno.toString());
        }

        assertEquals(1, annotations.size());

        objectParser.shutdown();
    } catch (RepositoryException | MalformedURLException | RepositoryConfigException e) {
        e.printStackTrace();
    }
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:21,代码来源:ObjectParserTest.java


示例9: testTurtle

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
@Test
public void testTurtle() throws UpdateExecutionException {
    try {
        URL url = new URL("http://example.com/");

        ObjectParser objectParser = new ObjectParser();
        List<Annotation> annotations = objectParser.parse(TURTLE, url, RDFFormat.TURTLE, true);

        for(Annotation anno : annotations) {
            System.out.println(anno.toString());
        }

        assertEquals(1, annotations.size());

        objectParser.shutdown();
    } catch (IOException | RepositoryException | RepositoryConfigException e) {
        e.printStackTrace();
    }
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:20,代码来源:ObjectParserTest.java


示例10: testMultipleTurtle

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
@Test
public void testMultipleTurtle() throws UpdateExecutionException {
    try {
        URL url = new URL("http://example.com/");

        ObjectParser objectParser = new ObjectParser();

        List<Annotation> annotations = new LinkedList<>();
        annotations.addAll(objectParser.parse(TURTLE, url, RDFFormat.TURTLE, true));
        annotations.addAll(objectParser.parse(TURTLE2, url, RDFFormat.TURTLE, true));
        annotations.addAll(objectParser.parse(TURTLE3, url, RDFFormat.TURTLE, true));

        assertEquals(3, annotations.size());

        for(Annotation anno : annotations) {
            System.out.println(anno.toString());
        }

        objectParser.shutdown();
    } catch (IOException | RepositoryException | RepositoryConfigException e) {
        e.printStackTrace();
    }
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:24,代码来源:ObjectParserTest.java


示例11: testMultipleInOneTurtle

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
@Test
public void testMultipleInOneTurtle() throws UpdateExecutionException {
    try {
        URL url = new URL("http://example.com/");

        ObjectParser objectParser = new ObjectParser();
        List<Annotation> annotations = objectParser.parse(TURTLE_MULTIPLE, url, RDFFormat.TURTLE, true);

        assertEquals(3, annotations.size());

        for(Annotation anno : annotations) {
            System.out.println(anno.toString());
        }

        objectParser.shutdown();
    } catch (IOException | RepositoryException | RepositoryConfigException e) {
        e.printStackTrace();
    }
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:20,代码来源:ObjectParserTest.java


示例12: validate

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
/**
 * Validates this configuration. If the configuration is invalid a
 * {@link StoreConfigException} is thrown including the reason why the
 * configuration is invalid.
 * 
 * @throws StoreConfigException
 *             If the configuration is invalid.
 */
@Override
public void validate() throws SailConfigException {
	super.validate();
	if (memberConfig.size() == 0) {
		throw new SailConfigException("No federation members specified");
	}
	
	// validate all member repositories
	for (RepositoryImplConfig cfg : memberConfig) {
		try {
			cfg.validate();
		} catch (RepositoryConfigException e) {
			throw new SailConfigException(e);
		}
	}
	
	this.selectorConfig.validate();
	this.optimizerConfig.validate();
}
 
开发者ID:goerlitz,项目名称:rdffederator,代码行数:28,代码来源:FederationSailConfig.java


示例13: getRepository

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
@Override
public Repository getRepository(RepositoryImplConfig config) throws RepositoryConfigException
{
    StardogRepository result = null;
    
    if(config instanceof StardogRepositoryConfig)
    {
        StardogRepositoryConfig stardogConfig = (StardogRepositoryConfig)config;
        try
        {
            stardogConfig.updateServerSettings(config);
        }
        catch(StardogException e)
        {
            throw new RuntimeException(e);
        }
        ConnectionConfiguration theConfig = stardogConfig.toConnectionConfiguration();
        result = new StardogRepository(theConfig);
    }
    else
    {
        throw new RepositoryConfigException("Invalid configuration class: " + config.getClass());
    }
    return result;
}
 
开发者ID:ansell,项目名称:sesame-stardog-manager,代码行数:26,代码来源:StardogRepositoryFactory.java


示例14: DataStore

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
public DataStore( String rawstoreloc ) {
	try {
		setStoreLocation( rawstoreloc );
	}
	catch ( RepositoryException | RepositoryConfigException e ) {
		log.fatal( e, e );
	}
}
 
开发者ID:Ostrich-Emulators,项目名称:semtool,代码行数:9,代码来源:DataStore.java


示例15: validate

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
@Override
/**
 * validate configuration
 *
 */
public void validate() throws RepositoryConfigException {
	super.validate();
	if (getQueryEndpointUrl() == null) {
		throw new RepositoryConfigException(
				"No endpoint URL specified for SPARQL repository");
	}
}
 
开发者ID:marklogic,项目名称:marklogic-sesame,代码行数:13,代码来源:MarkLogicRepositoryConfig.java


示例16: Anno4j

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
public Anno4j(Repository repository, IDGenerator idGenerator, URI defaultContext, boolean persistSchemaAnnotations, Set<URL> additionalClasses) throws RepositoryConfigException, RepositoryException {
    this.idGenerator = idGenerator;
    this.defaultContext = defaultContext;

    classpath = new HashSet<>();
    classpath.addAll(ClasspathHelper.forClassLoader());
    classpath.addAll(ClasspathHelper.forJavaClassPath());
    classpath.addAll(ClasspathHelper.forManifest());
    classpath.addAll(ClasspathHelper.forPackage(""));
    if(additionalClasses != null) {
        classpath.addAll(additionalClasses);
    }

    Reflections annotatedClasses = new Reflections(new ConfigurationBuilder()
            .setUrls(classpath)
            .useParallelExecutor()
            .filterInputsBy(FilterBuilder.parsePackages("-java, -javax, -sun, -com.sun"))
            .setScanners(new SubTypesScanner(), new TypeAnnotationsScanner(), new MethodAnnotationsScanner(), new FieldAnnotationsScanner()));

    // Bugfix: Searching for Reflections creates a lot ot Threads, that are not closed at the end by themselves,
    // so we close them manually.
    annotatedClasses.getConfiguration().getExecutorService().shutdown();

    // find classes with @Partial annotation
    this.partialClasses = annotatedClasses.getTypesAnnotatedWith(Partial.class, true);

    scanForEvaluators(annotatedClasses);

    if(!repository.isInitialized()) {
        repository.initialize();
    }

    this.setRepository(repository, additionalClasses, additionalClasses);

    // Persist schema information to repository:
    if(persistSchemaAnnotations) {
        persistSchemaAnnotations(annotatedClasses);
    }
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:40,代码来源:Anno4j.java


示例17: inequalityTest

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
@Test
public void inequalityTest() throws RepositoryException, QueryEvaluationException, MalformedQueryException, ParseException, RepositoryConfigException, IllegalAccessException, InstantiationException {
    List<Annotation> list = queryService.addCriteria("oa:hasBody[!ex:pathEqualityTestFirstValue is \"First Value\"]").execute();
    assertEquals(1, list.size());

    FirstPathEqualityTestBody firstPathEqualityTestBody = (FirstPathEqualityTestBody) list.get(0).getBodies().iterator().next();
    assertEquals("Second Value", firstPathEqualityTestBody.getValue());
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:9,代码来源:PathEqualityTest.java


示例18: firstBodyTest

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
@Test
public void firstBodyTest() throws RepositoryException, QueryEvaluationException, MalformedQueryException, ParseException, RepositoryConfigException, IllegalAccessException, InstantiationException {
    List<Annotation> list = queryService.addCriteria("oa:hasBody[ex:pathEqualityTestFirstValue is \"First Value\"]").execute();
    assertEquals(1, list.size());

    FirstPathEqualityTestBody firstPathEqualityTestBody = (FirstPathEqualityTestBody) list.get(0).getBodies().iterator().next();
    assertEquals("First Value", firstPathEqualityTestBody.getValue());
    assertEquals("Another Value", firstPathEqualityTestBody.getAnotherValue());
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:10,代码来源:PathEqualityTest.java


示例19: secondBodyTest

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
@Test
public void secondBodyTest() throws RepositoryException, QueryEvaluationException, MalformedQueryException, ParseException, RepositoryConfigException, IllegalAccessException, InstantiationException {
    List<Annotation> list1 = queryService.addCriteria("oa:hasBody[ex:pathEqualityTestSecondValue is \"Second Value\"]").execute();
    assertEquals(1, list1.size());

    SecondPathEqualityTestBody secondPathEqualityTestBody = (SecondPathEqualityTestBody) list1.get(0).getBodies().iterator().next();
    assertEquals("Second Value", secondPathEqualityTestBody.getValue());
    assertEquals("Another Value", secondPathEqualityTestBody.getAnotherValue());
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:10,代码来源:PathEqualityTest.java


示例20: bothBodyTest

import org.openrdf.repository.config.RepositoryConfigException; //导入依赖的package包/类
@Test
public void bothBodyTest() throws RepositoryException, QueryEvaluationException, MalformedQueryException, ParseException, RepositoryConfigException, IllegalAccessException, InstantiationException {
    List<Annotation> list1 = queryService.addCriteria("oa:hasBody[ex:pathEqualityTestAnotherValue is \"Another Value\"]").execute();
    assertEquals(2, list1.size());

    FirstPathEqualityTestBody firstPathEqualityTestBody = (FirstPathEqualityTestBody) list1.get(0).getBodies().iterator().next();
    assertEquals("First Value", firstPathEqualityTestBody.getValue());
    assertEquals("Another Value", firstPathEqualityTestBody.getAnotherValue());

    SecondPathEqualityTestBody secondPathEqualityTestBody = (SecondPathEqualityTestBody) list1.get(1).getBodies().iterator().next();
    assertEquals("Second Value", secondPathEqualityTestBody.getValue());
    assertEquals("Another Value", secondPathEqualityTestBody.getAnotherValue());
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:14,代码来源:PathEqualityTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RetryCache类代码示例发布时间:2022-05-22
下一篇:
Java PdfDocument类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap