Package org.apache.any23.extractor
Class SingleDocumentExtractionTest
- java.lang.Object
-
- org.apache.any23.AbstractAny23TestBase
-
- org.apache.any23.extractor.SingleDocumentExtractionTest
-
public class SingleDocumentExtractionTest extends AbstractAny23TestBase
Test case forSingleDocumentExtraction
.- Author:
- Michele Mostarda (mostarda@fbk.eu), Davide Palmisano (palmisano@fbk.eu)
-
-
Field Summary
-
Fields inherited from class org.apache.any23.AbstractAny23TestBase
tempDirectory, testFolder
-
-
Constructor Summary
Constructors Constructor Description SingleDocumentExtractionTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setUp()
void
tearDown()
void
testMicroformatDomains()
Tests the existence of the domain triples.void
testNestedMicroformats()
Tests the nested microformat relationships.void
testNestedMicroformatsInduced()
Tests the nested microformat relationships.void
testNestedMicroformatsManaged()
Tests the nested microformat relationships.void
testNestedVCardAdr()
This test assess the absence ofSINDICE
nesting relationship, sinceHCardExtractor
declared a native nesting with theAdrExtractor
.-
Methods inherited from class org.apache.any23.AbstractAny23TestBase
copyResourceToTempFile, getDocumentSourceFromResource, getDocumentSourceFromResource
-
-
-
-
Method Detail
-
setUp
public void setUp() throws Exception
- Overrides:
setUp
in classAbstractAny23TestBase
- Throws:
Exception
-
tearDown
public void tearDown() throws org.eclipse.rdf4j.sail.SailException, org.eclipse.rdf4j.repository.RepositoryException, TripleHandlerException
- Throws:
org.eclipse.rdf4j.sail.SailException
org.eclipse.rdf4j.repository.RepositoryException
TripleHandlerException
-
testMicroformatDomains
public void testMicroformatDomains() throws IOException, ExtractionException, org.eclipse.rdf4j.repository.RepositoryException
Tests the existence of the domain triples.- Throws:
IOException
- if there is an error loading input dataExtractionException
- if an exception is raised during extractionorg.eclipse.rdf4j.repository.RepositoryException
- if an error is encountered whilst loading content from a storage connection
-
testNestedMicroformats
public void testNestedMicroformats() throws IOException, ExtractionException, org.eclipse.rdf4j.repository.RepositoryException
Tests the nested microformat relationships. This test verifies the first supported approach for microformat nesting. Such approach foreseen to add a microformat HTML node within the property of a container microformat. For further details seeSingleDocumentExtraction
consolidateResources(java.util.List, java.util.List, org.apache.any23.writer.TripleHandler)}- Throws:
IOException
- if there is an error loading input dataExtractionException
- if an exception is raised during extractionorg.eclipse.rdf4j.repository.RepositoryException
- if an error is encountered whilst loading content from a storage connection
-
testNestedVCardAdr
public void testNestedVCardAdr() throws IOException, ExtractionException, org.eclipse.rdf4j.repository.RepositoryException
This test assess the absence ofSINDICE
nesting relationship, sinceHCardExtractor
declared a native nesting with theAdrExtractor
.- Throws:
IOException
- if there is an error loading input dataExtractionException
- if an exception is raised during extractionorg.eclipse.rdf4j.repository.RepositoryException
- if an error is encountered whilst loading content from a storage connection- See Also:
Includes
-
testNestedMicroformatsInduced
public void testNestedMicroformatsInduced() throws IOException, ExtractionException, org.eclipse.rdf4j.repository.RepositoryException
Tests the nested microformat relationships. This test verifies the second supported approach for microformat nesting. Such approach foreseen to use the same node attributes to declare both a microformat container property and a nested microformat root class. For further details seeSingleDocumentExtraction
consolidateResources(java.util.List, java.util.List, org.apache.any23.writer.TripleHandler)} See also the Nested Entities article that is linked by the official microformats.org doc page.- Throws:
IOException
- if there is an error loading input dataExtractionException
- if an exception is raised during extractionorg.eclipse.rdf4j.repository.RepositoryException
- if an error is encountered whilst loading content from a storage connection
-
testNestedMicroformatsManaged
public void testNestedMicroformatsManaged() throws IOException, ExtractionException, org.eclipse.rdf4j.repository.RepositoryException
Tests the nested microformat relationships. This test verifies the behavior of the nested microformats when the nesting relationship is handled by the microformat extractor itself (like the HReview that is able to detect an inner VCard).- Throws:
IOException
- if there is an error loading input dataExtractionException
- if an exception is raised during extractionorg.eclipse.rdf4j.repository.RepositoryException
- if an error is encountered whilst loading content from a storage connection
-
-