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


Java ResourceDescriptionImpl类代码示例

本文整理汇总了Java中cz.cuni.mff.odcleanstore.fusiontool.conflictresolution.impl.ResourceDescriptionImpl的典型用法代码示例。如果您正苦于以下问题:Java ResourceDescriptionImpl类的具体用法?Java ResourceDescriptionImpl怎么用?Java ResourceDescriptionImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ResourceDescriptionImpl类属于cz.cuni.mff.odcleanstore.fusiontool.conflictresolution.impl包,在下文中一共展示了ResourceDescriptionImpl类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getsExecutorWithEmptyInputFilter

import cz.cuni.mff.odcleanstore.fusiontool.conflictresolution.impl.ResourceDescriptionImpl; //导入依赖的package包/类
@Test
public void getsExecutorWithEmptyInputFilter() throws Exception {
    ConfigContainer config = mock(ConfigContainer.class);
    when(config.getMaxOutputTriples()).thenReturn(101L);

    // Act
    FusionToolDpuComponentFactory componentFactory = getComponentFactory(config);
    FusionExecutor executor = componentFactory.getExecutor(uriMapping);

    // Assert
    assertThat(executor, instanceOf(LDFusionToolExecutor.class));
    LDFusionToolExecutor typedExecutor = (LDFusionToolExecutor) executor;
    assertThat(typedExecutor.getMaxOutputTriples(), is(101L));
    ResourceDescriptionFilter filter = typedExecutor.getResourceDescriptionFilter();
    assertTrue(filter.accept(new ResourceDescriptionImpl(createHttpUri("r1"), ImmutableList.of(createHttpStatement("r1", "p", "o")))));
    assertTrue(filter.accept(new ResourceDescriptionImpl(createHttpUri("r2"),
            ImmutableList.of(VF.createStatement(createHttpUri("r2"), RDF.TYPE, createHttpUri("o"))))));
    assertTrue(filter.accept(new ResourceDescriptionImpl(createHttpUri("a2"), ImmutableList.of(createHttpStatement("a2", "p", "o")))));
}
 
开发者ID:UnifiedViews,项目名称:Plugins,代码行数:20,代码来源:FusionToolDpuComponentFactoryTest.java

示例2: getsExecutorWithClassAndMappingInputFilters

import cz.cuni.mff.odcleanstore.fusiontool.conflictresolution.impl.ResourceDescriptionImpl; //导入依赖的package包/类
@Test
public void getsExecutorWithClassAndMappingInputFilters() throws Exception {
    ConfigContainer config = mock(ConfigContainer.class);
    when(config.getMaxOutputTriples()).thenReturn(101L);
    when(config.getRequiredClassOfProcessedResources()).thenReturn(createHttpUri("c"));
    when(config.getOutputMappedSubjectsOnly()).thenReturn(true);

    // Act
    FusionToolDpuComponentFactory componentFactory = getComponentFactory(config);
    FusionExecutor executor = componentFactory.getExecutor(uriMapping);

    // Assert
    assertThat(executor, instanceOf(LDFusionToolExecutor.class));
    LDFusionToolExecutor typedExecutor = (LDFusionToolExecutor) executor;
    assertThat(typedExecutor.getMaxOutputTriples(), is(101L));
    ResourceDescriptionFilter filter = typedExecutor.getResourceDescriptionFilter();
    assertFalse(filter.accept(new ResourceDescriptionImpl(createHttpUri("r1"), ImmutableList.of(createHttpStatement("r1", "p", "o")))));
    assertFalse(filter.accept(new ResourceDescriptionImpl(createHttpUri("r2"),
            ImmutableList.of(VF.createStatement(createHttpUri("r2"), RDF.TYPE, createHttpUri("c"))))));
    assertFalse(filter.accept(new ResourceDescriptionImpl(createHttpUri("a2"), ImmutableList.of(createHttpStatement("a2", "p", "o")))));
    assertTrue(filter.accept(new ResourceDescriptionImpl(createHttpUri("b2"),
            ImmutableList.of(VF.createStatement(createHttpUri("b2"), RDF.TYPE, createHttpUri("c"))))));
}
 
开发者ID:UnifiedViews,项目名称:Plugins,代码行数:24,代码来源:FusionToolDpuComponentFactoryTest.java

示例3: next

import cz.cuni.mff.odcleanstore.fusiontool.conflictresolution.impl.ResourceDescriptionImpl; //导入依赖的package包/类
@Override
public ResourceDescription next() throws LDFusionToolException {
    if (subjectsQueue == null) {
        throw new IllegalStateException("Must be initialized with initialize() first");
    }
    String canonicalURI = canonicalSubjectsIterator.next();
    if (canonicalURI == null) {
        throw new NoSuchElementException();
    }
    addResolvedCanonicalUri(canonicalURI);

    ArrayList<Statement> quads = new ArrayList<Statement>();
    resourceQuadLoader.loadQuadsForURI(canonicalURI, quads);
    LOG.info("Loaded {} quads for URI <{}>", quads.size(), canonicalURI);
    Resource resource = quads.isEmpty() ? VF.createURI(canonicalURI) : quads.get(0).getSubject();
    return new ResourceDescriptionImpl(resource, quads);
}
 
开发者ID:mifeet,项目名称:LD-FusionTool,代码行数:18,代码来源:SubjectsSetInputLoader.java

示例4: cancelsExecution

import cz.cuni.mff.odcleanstore.fusiontool.conflictresolution.impl.ResourceDescriptionImpl; //导入依赖的package包/类
@Test
public void cancelsExecution() throws Exception {
    // Arrange
    final TestIsCanceledCallback callback = new TestIsCanceledCallback();
    LDFusionToolExecutor executor = getLDFusionToolExecutor(Long.MAX_VALUE, false);
    executor.setIsCanceledCallback(callback);
    final InputLoader inputLoader = Mockito.mock(InputLoader.class);
    Mockito.when(inputLoader.hasNext()).thenReturn(true);
    Mockito.when(inputLoader.next()).thenAnswer(new Answer<ResourceDescription>() {
        @Override
        public ResourceDescription answer(InvocationOnMock invocation) throws Throwable {
            callback.cancel();
            return new ResourceDescriptionImpl(createHttpUri("a"), ImmutableList.of(createHttpStatement("a", "b", "c")));
        }
    });

    // Act
    executor.fuse(new TestConflictResolver(), inputLoader, new TestRDFWriter());

    // Assert
    Mockito.verify(inputLoader, Mockito.times(1)).next();
}
 
开发者ID:mifeet,项目名称:LD-FusionTool,代码行数:23,代码来源:LDFusionToolExecutorTest.java

示例5: next

import cz.cuni.mff.odcleanstore.fusiontool.conflictresolution.impl.ResourceDescriptionImpl; //导入依赖的package包/类
@Override
public ResourceDescription next() throws LDFusionToolException {
    Collection<Statement> statements = iterator.next();
    if (statements.isEmpty()) {
        return new ResourceDescriptionImpl(null, statements);
    } else {
        return new ResourceDescriptionImpl(statements.iterator().next().getSubject(), statements);
    }
}
 
开发者ID:mifeet,项目名称:LD-FusionTool,代码行数:10,代码来源:TestInputLoader.java

示例6: next

import cz.cuni.mff.odcleanstore.fusiontool.conflictresolution.impl.ResourceDescriptionImpl; //导入依赖的package包/类
@Override
public ResourceDescription next() throws LDFusionToolException {
    checkState(dataFileIterator != null);
    checkState(mergedAttributeFileIterator != null);
    try {
        if (!dataFileIterator.hasNext()) {
            throw new NoSuchElementException();
        }
        ArrayList<Statement> describingStatements = new ArrayList<Statement>();

        // Read next record from dataFileIterator which represents the primary file
        // - the subject will determine the next cluster
        List<Value> nextTuple = dataFileIterator.next();
        Statement firstStatement = createStatement(nextTuple);
        Resource firstCanonicalSubject = (Resource) nextTuple.get(0);

        // Add quads for the cluster from primary data file
        describingStatements.add(firstStatement);
        while (NTuplesParserUtils.hasMatchingRecord(dataFileIterator, firstCanonicalSubject)) {
            describingStatements.add(createStatement(dataFileIterator.next()));
        }

        // Add additional quads from other files
        int extendedDescriptionCount = 0;
        boolean foundMatch = NTuplesParserUtils.skipLessThan(mergedAttributeFileIterator, firstCanonicalSubject, NTuplesParserUtils.VALUE_COMPARATOR);
        if (foundMatch) {
            while (NTuplesParserUtils.hasMatchingRecord(mergedAttributeFileIterator, firstCanonicalSubject)) {
                describingStatements.add(createStatement(mergedAttributeFileIterator.next()));
                extendedDescriptionCount++;
            }
        }

        LOG.debug("Loaded {} quads for resource <{}> (including {} triples in extended description)",
                new Object[]{describingStatements.size(), firstCanonicalSubject, extendedDescriptionCount});

        return new ResourceDescriptionImpl(firstCanonicalSubject, describingStatements);
    } catch (Exception e) {
        closeOnException();
        throw new LDFusionToolApplicationException(LDFusionToolErrorCodes.INPUT_LOADER_HAS_NEXT,
                "Error when reading temporary file in input loader", e);
    }
}
 
开发者ID:mifeet,项目名称:LD-FusionTool,代码行数:43,代码来源:ExternalSortingInputLoader.java


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