Skip to main content

LOD Linkset Enrichment Agent

The LOD Linkset Enrichment Agent creates links to external Linked Open Data sources.

πŸ“‹ Overview​

PropertyValue
Modulesrc.agents.rdf_linked_data.lod_linkset_enrichment_agent
ClassLODLinksetEnrichmentAgent
AuthorUIP Team
Version1.0.0

🎯 Purpose​

  • Link to external LOD sources (DBpedia, Wikidata, GeoNames)
  • Create owl:sameAs relations for entity reconciliation
  • Enrich entities with external knowledge
  • Maintain linkset quality metrics

🌐 External Sources​

SourceTypeLink Predicate
DBpediaKnowledge baseowl:sameAs
WikidataKnowledge graphowl:sameAs
GeoNamesGeographicgn:geonamesId
OpenStreetMapGeographicosm:node

πŸš€ Usage​

Enrich Entity​

from src.agents.rdf_linked_data.lod_linkset_enrichment_agent import LODLinksetEnrichmentAgent

agent = LODLinksetEnrichmentAgent()

# Enrich with external links
enriched = await agent.enrich(
entity_id="urn:ngsi-ld:TrafficCamera:CAM_001",
sources=["geonames", "osm"]
)

Create Linkset​

# Create linkset for entity type
linkset = await agent.create_linkset(
entity_type="TrafficCamera",
target_source="osm",
match_property="location"
)

Query External Data​

# Fetch external data for entity
external_data = await agent.fetch_external(
entity_id="urn:ngsi-ld:District:D1",
source="wikidata"
)
# Returns Wikidata properties for District 1

βš™οΈ Configuration​

# config/lod_linkset_mappings.yaml
lod_linkset:
enabled: true

# External endpoints
endpoints:
dbpedia:
sparql: "https://dbpedia.org/sparql"
lookup: "https://lookup.dbpedia.org/api/search"
wikidata:
sparql: "https://query.wikidata.org/sparql"
api: "https://www.wikidata.org/w/api.php"
geonames:
api: "http://api.geonames.org"
username: "${GEONAMES_USER}"
osm:
overpass: "https://overpass-api.de/api/interpreter"

# Matching rules
matching:
TrafficCamera:
sources: ["osm"]
match_by: "location"
radius_km: 0.1
District:
sources: ["wikidata", "geonames"]
match_by: "name"
PredicateDescriptionUse Case
owl:sameAsSame entityEntity reconciliation
rdfs:seeAlsoRelated resourceAdditional info
skos:exactMatchExact concept matchVocabulary mapping
skos:closeMatchClose concept matchApproximate mapping

See the complete agents reference for all available agents.