Package org.apache.any23.extractor.html
Class AbstractExtractorTestCase
- java.lang.Object
-
- org.apache.any23.AbstractAny23TestBase
-
- org.apache.any23.extractor.html.AbstractExtractorTestCase
-
- Direct Known Subclasses:
AbstractRDFaExtractorTestCase,AdrExtractorTest,CSVExtractorTest,EmbeddedJSONLDExtractorTest,FunctionalSyntaxExtractorTest,HAdrExtractorTest,HCalendarExtractorTest,HCardExtractorTest,HCardExtractorTest,HeadLinkExtractorTest,HEntryExtractorTest,HEventExtractorTest,HGeoExtractorTest,HItemExtractorTest,HListingExtractorTest,HProductExtractorTest,HRecipeExtractorTest,HRecipeExtractorTest,HResumeExtractorTest,HResumeExtractorTest,HReviewExtractorTest,HTMLMetaExtractorTest,ICalExtractorTest,JCalExtractorTest,LicenseExtractorTest,MicrodataExtractorTest,RDFMergerTest,SpeciesExtractorTest,TitleExtractorTest,TurtleHTMLExtractorTest,XCalExtractorTest,XFNExtractorTest,YAMLExtractorTest
public abstract class AbstractExtractorTestCase extends AbstractAny23TestBase
Abstract class used to writeExtractorspecific test cases.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.eclipse.rdf4j.model.IRIbaseIRIBase test document.protected org.eclipse.rdf4j.repository.RepositoryConnectionconnInternal connection used to collect extraction results.-
Fields inherited from class org.apache.any23.AbstractAny23TestBase
tempDirectory, testFolder
-
-
Constructor Summary
Constructors Constructor Description AbstractExtractorTestCase()Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidassertContains(org.eclipse.rdf4j.model.IRI p, String o)Asserts that the extracted triples contain the pattern(_ p o).protected voidassertContains(org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Resource o)Asserts that the extracted triples contain the pattern(_ p o).protected voidassertContains(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, String l)Assert that the model contains the statement(s p l)wherelis a literal.protected voidassertContains(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, String l, String lang)Assert that the model contains the statement(s p l)wherelis a language literal.protected voidassertContains(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o)Asserts that the extracted triples contain the pattern(s p o).protected voidassertContains(org.eclipse.rdf4j.model.Statement statement)Checks that a statement is contained in the extracted model.voidassertContainsModel(String modelResource)Verifies that the current model contains all the statements declared in the specifiedmodelFile.voidassertContainsModel(org.eclipse.rdf4j.model.Statement[] statements)Verifies that the current model contains all the given statements.protected voidassertExtract(String resource)Performs data extraction over the content of a resource and assert that the extraction was fine and raised no issues.protected voidassertExtract(String resource, boolean assertNoIssues)Performs data extraction over the content of a resource and assert that the extraction was fine.protected voidassertIssue(IssueReport.IssueLevel level, String issueRegex)Asserts that an issue has been produced by the processedExtractor.protected voidassertModelEmpty()Asserts that the model is expected to contains no statements.protected voidassertModelNotEmpty()Asserts that the model contains at least a statement.protected voidassertNoIssues()Asserts that the extraction generated no issues.protected voidassertNotContains(org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Resource o)Asserts that the extracted triples contain the pattern(_ p o).protected voidassertNotContains(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, String o)Asserts that the extracted triples contain the pattern(s p o).protected voidassertNotContains(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Literal o)Asserts that the model doesn't contain the pattern(s p o)protected voidassertNotContains(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Resource o)Asserts that the extracted triples contain the pattern(s p o).protected voidassertNotFound(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p)Asserts that the given pattern(s p _)is not present.protected voidassertStatementsSize(org.eclipse.rdf4j.model.IRI p, String o, int expected)Asserts that the given pattern(_ p o)satisfies the expected number of statements.protected voidassertStatementsSize(org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o, int expected)Asserts that the given pattern(_ p o)satisfies the expected number of statements.protected voidassertStatementsSize(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o, int expected)Asserts that the given pattern(s p o)satisfies the expected number of statements.protected List<org.eclipse.rdf4j.model.Statement>dumpAsListOfStatements()Dumps the list of statements contained in the extracted model.protected StringdumpHumanReadableTriples()protected StringdumpModelToNQuads()Dumps the extracted model in NQuads format.protected StringdumpModelToRDFXML()Dumps the extracted model in RDFXML format.protected StringdumpModelToTurtle()Dumps the extracted model in Turtle format.protected voidextract(String resource)Applies the extractor provided by thegetExtractorFactory()to the specified resource.protected org.eclipse.rdf4j.model.ResourcefindExactlyOneBlankSubject(org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o)Returns the blank subject matching the pattern(_:b p o), it is expected to exists and be just one.protected org.eclipse.rdf4j.model.ValuefindExactlyOneObject(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p)Returns the object matching the pattern(s p o), it is expected to exists and be just one.protected org.eclipse.rdf4j.model.ValuefindObject(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p)Finds the object matching the pattern(s p _), asserts to find exactly one result.protected StringfindObjectAsLiteral(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p)Finds the literal object matching the pattern(s p _), asserts to find exactly one result.protected org.eclipse.rdf4j.model.ResourcefindObjectAsResource(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p)Finds the resource object matching the pattern(s p _), asserts to find exactly one result.protected List<org.eclipse.rdf4j.model.Value>findObjects(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p)Returns all the objects matching the pattern(s p _).protected List<org.eclipse.rdf4j.model.Resource>findSubjects(org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o)Returns all the subjects matching the pattern(s? p o).protected org.eclipse.rdf4j.repository.RepositoryConnectiongetConnection()protected abstract ExtractorFactory<?>getExtractorFactory()protected Collection<IssueReport.Issue>getIssues()Returns the list of issues raised by the extractor under testing.protected Collection<IssueReport.Issue>getIssues(String extractorName)Returns the list of issues raised by a given extractor.protected SingleDocumentExtractionReportgetReport()protected org.eclipse.rdf4j.repository.RepositoryResult<org.eclipse.rdf4j.model.Statement>getStatements(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o)Returns all statements matching the pattern(s p o).protected intgetStatementsSize(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o)Counts all statements matching the pattern(s p o).voidsetUp()Test case initialization.voidtearDown()Test case resources release.-
Methods inherited from class org.apache.any23.AbstractAny23TestBase
copyResourceToTempFile, getDocumentSourceFromResource, getDocumentSourceFromResource
-
-
-
-
Method Detail
-
getExtractorFactory
protected abstract ExtractorFactory<?> getExtractorFactory()
- Returns:
- the factory of the extractor to be tested.
-
setUp
public void setUp() throws ExceptionTest case initialization.- Overrides:
setUpin classAbstractAny23TestBase- Throws:
Exception- if there is an error constructing input objects
-
tearDown
public void tearDown() throws org.eclipse.rdf4j.repository.RepositoryExceptionTest case resources release.- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
getConnection
protected org.eclipse.rdf4j.repository.RepositoryConnection getConnection()
- Returns:
- the connection to the memory repository.
-
getReport
protected SingleDocumentExtractionReport getReport()
- Returns:
- the last generated report.
-
getIssues
protected Collection<IssueReport.Issue> getIssues(String extractorName)
Returns the list of issues raised by a given extractor.- Parameters:
extractorName- name of the extractor.- Returns:
- collection of issues.
-
getIssues
protected Collection<IssueReport.Issue> getIssues()
Returns the list of issues raised by the extractor under testing.- Returns:
- collection of issues.
-
extract
protected void extract(String resource) throws ExtractionException, IOException
Applies the extractor provided by thegetExtractorFactory()to the specified resource.- Parameters:
resource- resource name.- Throws:
ExtractionException- if there is an exception during extractionIOException- if there is an error processing the input data
-
assertExtract
protected void assertExtract(String resource, boolean assertNoIssues)
Performs data extraction over the content of a resource and assert that the extraction was fine.- Parameters:
resource- resource name.assertNoIssues- iftrueinvokesassertNoIssues()after the extraction.
-
assertExtract
protected void assertExtract(String resource)
Performs data extraction over the content of a resource and assert that the extraction was fine and raised no issues.- Parameters:
resource- input resource to test extraction on.
-
assertContains
protected void assertContains(org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Resource o) throws org.eclipse.rdf4j.repository.RepositoryExceptionAsserts that the extracted triples contain the pattern(_ p o).- Parameters:
p- predicateo- object.- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
assertContains
protected void assertContains(org.eclipse.rdf4j.model.IRI p, String o) throws org.eclipse.rdf4j.repository.RepositoryExceptionAsserts that the extracted triples contain the pattern(_ p o).- Parameters:
p- predicateo- object.- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
assertNotContains
protected void assertNotContains(org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Resource o) throws org.eclipse.rdf4j.repository.RepositoryExceptionAsserts that the extracted triples contain the pattern(_ p o).- Parameters:
p- predicateo- object.- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
assertContains
protected void assertContains(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o) throws org.eclipse.rdf4j.repository.RepositoryExceptionAsserts that the extracted triples contain the pattern(s p o).- Parameters:
s- subject.p- predicate.o- object.- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
assertNotContains
protected void assertNotContains(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, String o) throws org.eclipse.rdf4j.repository.RepositoryExceptionAsserts that the extracted triples contain the pattern(s p o).- Parameters:
s- subject.p- predicate.o- object.- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
assertNotContains
protected void assertNotContains(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Resource o) throws org.eclipse.rdf4j.repository.RepositoryExceptionAsserts that the extracted triples contain the pattern(s p o).- Parameters:
s- subject.p- predicate.o- object.- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
assertModelNotEmpty
protected void assertModelNotEmpty() throws org.eclipse.rdf4j.repository.RepositoryExceptionAsserts that the model contains at least a statement.- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
assertNotContains
protected void assertNotContains(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Literal o) throws org.eclipse.rdf4j.repository.RepositoryExceptionAsserts that the model doesn't contain the pattern(s p o)- Parameters:
s- subject.p- predicate.o- object.- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
assertModelEmpty
protected void assertModelEmpty() throws org.eclipse.rdf4j.repository.RepositoryExceptionAsserts that the model is expected to contains no statements.- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
assertNoIssues
protected void assertNoIssues()
Asserts that the extraction generated no issues.
-
assertIssue
protected void assertIssue(IssueReport.IssueLevel level, String issueRegex)
Asserts that an issue has been produced by the processedExtractor.- Parameters:
level- expected issue levelissueRegex- regex matching the expected human readable issue message.
-
assertContainsModel
public void assertContainsModel(org.eclipse.rdf4j.model.Statement[] statements) throws org.eclipse.rdf4j.repository.RepositoryExceptionVerifies that the current model contains all the given statements.- Parameters:
statements- list of statements to be verified.- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
assertContainsModel
public void assertContainsModel(String modelResource) throws org.eclipse.rdf4j.rio.RDFHandlerException, IOException, org.eclipse.rdf4j.rio.RDFParseException, org.eclipse.rdf4j.repository.RepositoryException
Verifies that the current model contains all the statements declared in the specifiedmodelFile.- Parameters:
modelResource- the resource containing the model.- Throws:
org.eclipse.rdf4j.rio.RDFHandlerException- if there is an error within theRDFHandlerIOException- if there is an error processing the input dataorg.eclipse.rdf4j.rio.RDFParseException- if there is an exception parsing the RDF streamorg.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
assertStatementsSize
protected void assertStatementsSize(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o, int expected) throws org.eclipse.rdf4j.rio.RDFHandlerException, org.eclipse.rdf4j.repository.RepositoryExceptionAsserts that the given pattern(s p o)satisfies the expected number of statements.- Parameters:
s- subject.p- predicate.o- object.expected- expected matches.- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connectionorg.eclipse.rdf4j.rio.RDFHandlerException
-
assertStatementsSize
protected void assertStatementsSize(org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o, int expected) throws org.eclipse.rdf4j.rio.RDFHandlerException, org.eclipse.rdf4j.repository.RepositoryExceptionAsserts that the given pattern(_ p o)satisfies the expected number of statements.- Parameters:
p- predicate.o- object.expected- expected matches.- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connectionorg.eclipse.rdf4j.rio.RDFHandlerException
-
assertStatementsSize
protected void assertStatementsSize(org.eclipse.rdf4j.model.IRI p, String o, int expected) throws org.eclipse.rdf4j.rio.RDFHandlerException, org.eclipse.rdf4j.repository.RepositoryExceptionAsserts that the given pattern(_ p o)satisfies the expected number of statements.- Parameters:
p- predicate.o- object.expected- expected matches.- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connectionorg.eclipse.rdf4j.rio.RDFHandlerException
-
assertNotFound
protected void assertNotFound(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p) throws org.eclipse.rdf4j.repository.RepositoryExceptionAsserts that the given pattern(s p _)is not present.- Parameters:
s- subject.p- predicate.- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
findExactlyOneBlankSubject
protected org.eclipse.rdf4j.model.Resource findExactlyOneBlankSubject(org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o) throws org.eclipse.rdf4j.repository.RepositoryExceptionReturns the blank subject matching the pattern(_:b p o), it is expected to exists and be just one.- Parameters:
p- predicate.o- object.- Returns:
- the matching blank subject.
- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
findExactlyOneObject
protected org.eclipse.rdf4j.model.Value findExactlyOneObject(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p) throws org.eclipse.rdf4j.repository.RepositoryExceptionReturns the object matching the pattern(s p o), it is expected to exists and be just one.- Parameters:
s- subject.p- predicate.- Returns:
- the matching object.
- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
findSubjects
protected List<org.eclipse.rdf4j.model.Resource> findSubjects(org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o) throws org.eclipse.rdf4j.repository.RepositoryException
Returns all the subjects matching the pattern(s? p o).- Parameters:
p- predicate.o- object.- Returns:
- list of matching subjects.
- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
findObjects
protected List<org.eclipse.rdf4j.model.Value> findObjects(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p) throws org.eclipse.rdf4j.repository.RepositoryException
Returns all the objects matching the pattern(s p _).- Parameters:
s- predicate.p- predicate.- Returns:
- list of matching objects.
- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
findObject
protected org.eclipse.rdf4j.model.Value findObject(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p) throws org.eclipse.rdf4j.repository.RepositoryExceptionFinds the object matching the pattern(s p _), asserts to find exactly one result.- Parameters:
s- subject.p- predicate- Returns:
- matching object.
- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
findObjectAsResource
protected org.eclipse.rdf4j.model.Resource findObjectAsResource(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p) throws org.eclipse.rdf4j.repository.RepositoryExceptionFinds the resource object matching the pattern(s p _), asserts to find exactly one result.- Parameters:
s- subject.p- predicate.- Returns:
- matching object.
- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
findObjectAsLiteral
protected String findObjectAsLiteral(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p) throws org.eclipse.rdf4j.repository.RepositoryException
Finds the literal object matching the pattern(s p _), asserts to find exactly one result.- Parameters:
s- subject.p- predicate.- Returns:
- matching object.
- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
dumpModelToTurtle
protected String dumpModelToTurtle() throws org.eclipse.rdf4j.repository.RepositoryException
Dumps the extracted model in Turtle format.- Returns:
- a string containing the model in Turtle.
- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
dumpModelToNQuads
protected String dumpModelToNQuads() throws org.eclipse.rdf4j.repository.RepositoryException
Dumps the extracted model in NQuads format.- Returns:
- a string containing the model in NQuads.
- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
dumpModelToRDFXML
protected String dumpModelToRDFXML() throws org.eclipse.rdf4j.repository.RepositoryException
Dumps the extracted model in RDFXML format.- Returns:
- a string containing the model in RDFXML.
- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
dumpAsListOfStatements
protected List<org.eclipse.rdf4j.model.Statement> dumpAsListOfStatements() throws org.eclipse.rdf4j.repository.RepositoryException
Dumps the list of statements contained in the extracted model.- Returns:
- list of extracted statements.
- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
dumpHumanReadableTriples
protected String dumpHumanReadableTriples() throws org.eclipse.rdf4j.repository.RepositoryException
- Returns:
- string containing human readable statements.
- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
assertContains
protected void assertContains(org.eclipse.rdf4j.model.Statement statement) throws org.eclipse.rdf4j.repository.RepositoryExceptionChecks that a statement is contained in the extracted model. If the statement declares bnodes, they are replaced with_patterns.- Parameters:
statement- an RDFStatementimplementation- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
assertContains
protected void assertContains(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, String l) throws org.eclipse.rdf4j.repository.RepositoryExceptionAssert that the model contains the statement(s p l)wherelis a literal.- Parameters:
s- subject.p- predicate.l- literal content.- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
assertContains
protected void assertContains(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, String l, String lang) throws org.eclipse.rdf4j.repository.RepositoryExceptionAssert that the model contains the statement(s p l)wherelis a language literal.- Parameters:
s- subject.p- predicate.l- literal content.lang- literal language.- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
getStatements
protected org.eclipse.rdf4j.repository.RepositoryResult<org.eclipse.rdf4j.model.Statement> getStatements(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o) throws org.eclipse.rdf4j.repository.RepositoryExceptionReturns all statements matching the pattern(s p o).- Parameters:
s- subject.p- predicate.o- object.- Returns:
- list of statements.
- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
getStatementsSize
protected int getStatementsSize(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o) throws org.eclipse.rdf4j.repository.RepositoryExceptionCounts all statements matching the pattern(s p o).- Parameters:
s- subject.p- predicate.o- object.- Returns:
- number of matches.
- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if an error is encountered whilst loading content from a storage connection
-
-