You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
predicate: The RDF predicate for the spatial data.
value: The GeoJSON or GeoJSON string to be added.
Note:
This function will first attempt to add the value as a WKT and, if unsuccessful, add it as a GeoJSON literal, to comply with GeoDCAT-AP, which states that the geometries MAY be provided in multiple encodings, but at least one of the following MUST be provided GML and WKT.(https://semiceu.github.io/GeoDCAT-AP/drafts/latest/#bounding-box)
Raises:
TypeError: If the input value is of an unsupported type.
ValueError: If there's an error in converting GeoJSON to WKT.
InvalidGeoJSONException: If the GeoJSON is invalid.
"""
try:
ifisinstance(value, str):
# Try to parse the input as a GeoJSON string
geojson_obj=json.loads(value)
else:
geojson_obj=value
# Attempt to convert the GeoJSON object to WKT with 4 decimals
wkt_string=wkt.dumps(geojson_obj, decimals=4)
# Create a Literal with the WKT representation and add it to the RDF graph
Returns the value of a field from the most recently modified dataset.
Args:
field_name (str): The name of the field to retrieve from datasets list
default_values_dict (dict): A dictionary of default values to use if the field is not found. Defaults to euro_dcat_ap_default_values.
fallback (str): The name of the fallback field to retrieve if `field_name` is not found. Defaults to None.
return_none (bool): Whether to return None if the field is not found. Defaults to False.
order (str): The order in which to sort the results. Defaults to 'desc'.
Returns:
The value of the field, or the default value if it could not be found and `return_none` is False.
Notes:
This function caches the result of the CKAN API call to improve performance. The cache is stored in the `_catalog_search_result` attribute of the object. If the attribute exists, the function will return the value of the requested field from the cached result instead of making a new API call. If the attribute does not exist, the function will make a new API call and store the result in the attribute for future use.
# _add_wkt_or_geojson_value_to_graph to comply with GeoDCAT-AP: Geometries MAY be provided in multiple encodings, but at least one of the following MUST be made available: GML and WKT.(https://semiceu.github.io/GeoDCAT-AP/drafts/latest/#bounding-box)
Fix the elements exposed by the RDF endpoint which are now multilingual thanks to
mjanez/ckanext-fluent
.profiles.py
to add all languages for a metadata element that have a fluent field.ckanext-dcat/ckanext/dcat/profiles.py
Lines 1 to 2838 in cf5b39a
The text was updated successfully, but these errors were encountered: