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 writeExtractor
specific test cases.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.eclipse.rdf4j.model.IRI
baseIRI
Base test document.protected org.eclipse.rdf4j.repository.RepositoryConnection
conn
Internal 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 void
assertContains(org.eclipse.rdf4j.model.IRI p, String o)
Asserts that the extracted triples contain the pattern(_ p o)
.protected void
assertContains(org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Resource o)
Asserts that the extracted triples contain the pattern(_ p o)
.protected void
assertContains(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, String l)
Assert that the model contains the statement(s p l)
wherel
is a literal.protected void
assertContains(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)
wherel
is a language literal.protected void
assertContains(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 void
assertContains(org.eclipse.rdf4j.model.Statement statement)
Checks that a statement is contained in the extracted model.void
assertContainsModel(String modelResource)
Verifies that the current model contains all the statements declared in the specifiedmodelFile
.void
assertContainsModel(org.eclipse.rdf4j.model.Statement[] statements)
Verifies that the current model contains all the given statements.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.protected void
assertExtract(String resource, boolean assertNoIssues)
Performs data extraction over the content of a resource and assert that the extraction was fine.protected void
assertIssue(IssueReport.IssueLevel level, String issueRegex)
Asserts that an issue has been produced by the processedExtractor
.protected void
assertModelEmpty()
Asserts that the model is expected to contains no statements.protected void
assertModelNotEmpty()
Asserts that the model contains at least a statement.protected void
assertNoIssues()
Asserts that the extraction generated no issues.protected void
assertNotContains(org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Resource o)
Asserts that the extracted triples contain the pattern(_ p o)
.protected void
assertNotContains(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 void
assertNotContains(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 void
assertNotContains(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 void
assertNotFound(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p)
Asserts that the given pattern(s p _)
is not present.protected void
assertStatementsSize(org.eclipse.rdf4j.model.IRI p, String o, int expected)
Asserts that the given pattern(_ p o)
satisfies the expected number of statements.protected void
assertStatementsSize(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 void
assertStatementsSize(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 String
dumpHumanReadableTriples()
protected String
dumpModelToNQuads()
Dumps the extracted model in NQuads format.protected String
dumpModelToRDFXML()
Dumps the extracted model in RDFXML format.protected String
dumpModelToTurtle()
Dumps the extracted model in Turtle format.protected void
extract(String resource)
Applies the extractor provided by thegetExtractorFactory()
to the specified resource.protected org.eclipse.rdf4j.model.Resource
findExactlyOneBlankSubject(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.Value
findExactlyOneObject(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.Value
findObject(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 String
findObjectAsLiteral(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.Resource
findObjectAsResource(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.RepositoryConnection
getConnection()
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 SingleDocumentExtractionReport
getReport()
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 int
getStatementsSize(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)
.void
setUp()
Test case initialization.void
tearDown()
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 Exception
Test case initialization.- Overrides:
setUp
in classAbstractAny23TestBase
- Throws:
Exception
- if there is an error constructing input objects
-
tearDown
public void tearDown() throws org.eclipse.rdf4j.repository.RepositoryException
Test 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
- iftrue
invokesassertNoIssues()
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.RepositoryException
Asserts 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.RepositoryException
Asserts 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.RepositoryException
Asserts 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.RepositoryException
Asserts 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.RepositoryException
Asserts 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.RepositoryException
Asserts 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.RepositoryException
Asserts 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.RepositoryException
Asserts 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.RepositoryException
Asserts 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.RepositoryException
Verifies 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 theRDFHandler
IOException
- 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.RepositoryException
Asserts 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.RepositoryException
Asserts 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.RepositoryException
Asserts 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.RepositoryException
Asserts 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.RepositoryException
Returns 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.RepositoryException
Returns 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.RepositoryException
Finds 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.RepositoryException
Finds 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.RepositoryException
Checks that a statement is contained in the extracted model. If the statement declares bnodes, they are replaced with_
patterns.- Parameters:
statement
- an RDFStatement
implementation- 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.RepositoryException
Assert that the model contains the statement(s p l)
wherel
is 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.RepositoryException
Assert that the model contains the statement(s p l)
wherel
is 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.RepositoryException
Returns 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.RepositoryException
Counts 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
-
-