public class DataSampler extends Object
Modifier and Type | Field and Description |
---|---|
static QName |
BOUNDED_BY |
Constructor and Description |
---|
DataSampler(Document wfsCapabilities)
Constructs a new DataSampler for a particular WFS implementation.
|
Modifier and Type | Method and Description |
---|---|
void |
acquireFeatureData()
Attempts to acquire instances of all feature types supported by the WFS
using all supported GetFeature message bindings (request encodings).
|
boolean |
deleteData()
Deletes all saved data files.
|
net.sf.saxon.s9api.XdmValue |
evaluateXPathAgainstSampleData(String expr,
Map<String,String> nsBindings)
Evaluates the given XPath expression against all sample data sets.
|
Element |
getFeatureById(String id)
Returns a feature instance from the sample data.
|
String |
getFeatureId()
Returns the identifier (gml:id attribute value) for an existing feature instance.
|
String |
getFeatureIdNotOfType(QName featureType)
Returns the identifier (gml:id attribute value) for an existing feature instance.
|
Map<QName,FeatureTypeInfo> |
getFeatureTypeInfo()
Returns a Map containing information about the feature types supported by
the WFS.
|
List<QName> |
getNillableProperties(org.apache.xerces.xs.XSModel model,
QName featureType)
Determines a property which is nillable and contains nilled properties for the specified feature type in the
sample data.
|
List<String> |
getSimplePropertyValues(QName featureType,
QName propName,
String featureId)
Returns a list containing the values (in document order) of the specified
feature property in the sample data set.
|
org.opengis.geometry.Envelope |
getSpatialExtent(org.apache.xerces.xs.XSModel model,
QName featureType)
Determines the spatial extent of the feature instances in the sample
data.
|
org.opengis.temporal.Period |
getTemporalExtentOfProperty(org.apache.xerces.xs.XSModel model,
QName featureType,
org.apache.xerces.xs.XSElementDeclaration tmPropDecl)
Determines the temporal extent of all instances of the specified feature
property in the sample data.
|
Element |
randomlySelectFeatureInstance()
Randomly selects a feature instance from the sample data obtained from
the IUT.
|
QName |
selectFeatureType()
Sort alphabetically and selects first feature type name for which
instances are available in the SUT.
|
Set<String> |
selectRandomFeatureIdentifiers(QName featureType,
int numId)
Returns a set of identifiers for available feature instances of a given
type.
|
void |
setMaxFeatures(int maxFeatures)
Sets the maximum number of features to include in the response entity.
|
public static final QName BOUNDED_BY
public DataSampler(Document wfsCapabilities)
wfsCapabilities
- A DOM Document representing the service metadata
(/wfs:WFS_Capabilities).public void setMaxFeatures(int maxFeatures)
maxFeatures
- An integer value > 0 (the default value is 25).public Set<String> selectRandomFeatureIdentifiers(QName featureType, int numId)
featureType
- A QName representing the qualified name of some feature type.numId
- The desired number of identifiers.public List<String> getSimplePropertyValues(QName featureType, QName propName, String featureId)
featureType
- A QName representing the qualified name of some feature type.propName
- The name of the property.featureId
- A feature identifer (gml:id); if null
or empty the
evaluation context includes all members of the collection.public boolean deleteData()
true
if all data files were deleted; false
otherwise (see warnings in log file for details).public void acquireFeatureData()
FeatureTypeInfo.isInstantiated()
returns false
.public Map<QName,FeatureTypeInfo> getFeatureTypeInfo()
public Element getFeatureById(String id)
id
- The feature identifier (@gml:id).public String getFeatureIdNotOfType(QName featureType)
featureType
- The qualified name of a the feature type the feature should not be an instance from.public String getFeatureId()
public org.opengis.geometry.Envelope getSpatialExtent(org.apache.xerces.xs.XSModel model, QName featureType)
model
- A model representing the supported GML application schema.featureType
- The name of the feature type.public org.opengis.temporal.Period getTemporalExtentOfProperty(org.apache.xerces.xs.XSModel model, QName featureType, org.apache.xerces.xs.XSElementDeclaration tmPropDecl)
model
- A model representing the relevant GML application schema.featureType
- The name of the feature type.tmPropDecl
- A declaration of a temporal property.public List<QName> getNillableProperties(org.apache.xerces.xs.XSModel model, QName featureType)
model
- A model representing the relevant GML application schema, never null
.featureType
- The name of the feature type, never null
.public Element randomlySelectFeatureInstance()
public QName selectFeatureType()
null
if no data exist in the SUT.public net.sf.saxon.s9api.XdmValue evaluateXPathAgainstSampleData(String expr, Map<String,String> nsBindings)
expr
- An XPath 2.0 expression.nsBindings
- A collection of namespace bindings required to evaluate the
XPath expression, where each entry maps a namespace URI (key)
to a prefix (value).Copyright © 2022 Open Geospatial Consortium. All rights reserved.