🔗 Tích hợp Linked Open Data trong UIP
· 4 phút để đọc
Một trong những điểm đặc biệt của UIP là việc tích hợp Linked Open Data (LOD) - công nghệ cho phép dữ liệu giao thông được liên kết và chia sẻ theo chuẩn quốc tế.
🎯 Tại sao Linked Open Data?
Vấn đề với dữ liệu truyền thống
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Camera DB │ │ Weather DB │ │ AQI DB │
│ (MongoDB) │ │ (API) │ │ (External) │
└──────┬──────┘ └──────┬──────┘ └──────┬──────┘
│ │ │
▼ ▼ ▼
Isolated Isolated Isolated
Data Data Data
Vấn đề:
- ❌ Dữ liệu phân tán, không liên kết
- ❌ Khó truy vấn cross-domain
- ❌ Không có ngữ nghĩa (semantic)
- ❌ Khó tích hợp với hệ thống khác
Giải pháp LOD
┌─────────────────────────────────────────────────────┐
│ Linked Data Cloud │
│ │
│ TrafficCamera ──→ observes ──→ TrafficFlow │
│ │ │ │
│ ▼ ▼ │
│ locatedIn ──→ District ←── hasWeather ←── Weather │
│ │ │
│ ▼ │
│ near ──→ AirQualityStation │
└────────────────────────────────────────────── ───────┘
Lợi ích:
- ✅ Dữ liệu liên kết semantic
- ✅ Truy vấn SPARQL mạnh mẽ
- ✅ Interoperable với global datasets
- ✅ Machine-readable & discoverable
🏗️ Kiến trúc LOD trong UIP
Technology Stack
| Component | Technology | Purpose |
|---|---|---|
| Data Model | NGSI-LD | Context Information |
| Ontology | SOSA/SSN | Sensor Semantics |
| Triple Store | Apache Jena Fuseki | RDF Storage |
| Query | SPARQL 1.1 | Data Retrieval |
| Serialization | JSON-LD, Turtle, RDF/XML | Data Exchange |
Data Flow
graph TD
A[Raw Camera Data] --> B[NGSI-LD Transformer]
B --> C[SOSA/SSN Mapper]
C --> D[RDF Generator]
D --> E[Fuseki Triple Store]
E --> F[SPARQL Endpoint]
F --> G[Content Negotiation]
G --> H[JSON-LD / Turtle / RDF-XML]
📊 NGSI-LD Implementation
Traffic Camera Entity
{
"@context": [
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld",
{
"TrafficCamera": "https://uip.hcm.gov.vn/ontology#TrafficCamera",
"vehicleCount": "https://uip.hcm.gov.vn/ontology#vehicleCount",
"congestionLevel": "https://uip.hcm.gov.vn/ontology#congestionLevel"
}
],
"id": "urn:ngsi-ld:TrafficCamera:CAM001",
"type": "TrafficCamera",
"name": {
"type": "Property",
"value": "Camera Nguyễn Huệ - Lê Lợi"
},
"location": {
"type": "GeoProperty",
"value": {
"type": "Point",
"coordinates": [106.7004, 10.7731]
}
},
"vehicleCount": {
"type": "Property",
"value": 156,
"observedAt": "2025-11-22T08:30:00Z",
"unitCode": "vehicles"
},
"congestionLevel": {
"type": "Property",
"value": "high",
"observedAt": "2025-11-22T08:30:00Z"
},
"refDistrict": {
"type": "Relationship",
"object": "urn:ngsi-ld:District:D1"
}
}
🔬 SOSA/SSN Ontology Mapping
Sensor Observation Pattern
@prefix sosa: <http://www.w3.org/ns/sosa/> .
@prefix ssn: <http://www.w3.org/ns/ssn/> .
@prefix uip: <https://uip.hcm.gov.vn/ontology#> .
@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
# Camera as Sensor
uip:CAM001 a sosa:Sensor ;
rdfs:label "Camera Nguyễn Huệ - Lê Lợi"@vi ;
sosa:observes uip:VehicleCountProperty ;
sosa:isHostedBy uip:TrafficPole001 ;
geo:lat 10.7731 ;
geo:long 106.7004 .
# Observation
uip:OBS001 a sosa:Observation ;
sosa:madeBySensor uip:CAM001 ;
sosa:observedProperty uip:VehicleCountProperty ;
sosa:hasSimpleResult 156 ;
sosa:resultTime "2025-11-22T08:30:00Z"^^xsd:dateTime ;
sosa:hasFeatureOfInterest uip:RoadSegment001 .
# Observable Property
uip:VehicleCountProperty a sosa:ObservableProperty ;
rdfs:label "Vehicle Count"@en ;
rdfs:label "Số lượng phương tiện"@vi .
