Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ savaime — užtenka, kad jie naudotų tuos pačius URI.
graph LR
person(["persons/7194/#this"]) -->|foaf:name| name["Algirdas Butkevičius"]
membership(["…/#membership-1322-…"]) -->|org:member| person
membership -->|org:organization| faction(["org-units/1322/#this"])
membership -->|org:organization| faction(["…/seimas/org-units/1322/#this"])
membership -->|org:memberDuring| interval["time:Interval<br/>nuo 2024-11-14"]
faction -->|skos:prefLabel| fname["Demokratų frakcija<br/>„Vardan Lietuvos“"]
faction -->|org:unitOf| seimas(["organizations/<br/>lietuvos-respublikos-seimas/#this"])
Expand Down
25 changes: 25 additions & 0 deletions app/organizations/lietuvos-respublikos-seimas.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@prefix cv: <http://data.europa.eu/m8g/> .
@prefix dh: <https://www.w3.org/ns/ldt/document-hierarchy#> .
@prefix ldh: <https://w3id.org/atomgraph/linkeddatahub#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix org: <http://www.w3.org/ns/org#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .

# The Seimas organization document is a dh:Container (its structural units and
# parliamentary groups nest under it) that is also the org entity itself —
# same pattern as the taxonomy scheme containers (app/taxonomies/*.ttl).
# Static data, so it lives in scaffolding rather than ETL output; the units
# reference it via org:unitOf.
<> a dh:Container ;
dct:title "Lietuvos Respublikos Seimas"@lt ;
foaf:primaryTopic <#this> ;
rdf:_1 <#select-children> .

<#this> a org:FormalOrganization, cv:PublicOrganisation ;
skos:prefLabel "Lietuvos Respublikos Seimas"@lt, "Seimas of the Republic of Lithuania"@en ;
foaf:homepage <https://www.lrs.lt/> .

<#select-children> a ldh:Object ;
rdf:value ldh:ChildrenView .
File renamed without changes.
2,270 changes: 1,128 additions & 1,142 deletions datasets/current/seimas/org-units.trig

Large diffs are not rendered by default.

37,840 changes: 18,920 additions & 18,920 deletions datasets/current/seimas/persons.trig

Large diffs are not rendered by default.

33 changes: 28 additions & 5 deletions etl/URI-SCHEME.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,31 @@ the committed outputs under `datasets/current/` use the default
scheme docs) are **not** ETL output: they are scaffolding, one Turtle
file per container under `app/`, PUT over HTTP by `make install` via the
LDH CLI — LDH adds `sioc:has_parent` and ownership metadata server-side.
2. **Fold by type**: all instances of one class share one flat container.
Hierarchy lives in RDF (`dct:isPartOf`), never in URI paths.
2. **Fold standalone entities by type; nest constituent parts under their
whole.** Independent entities of one class share one flat top-level
container (`persons/`, `parties/`, `organizations/`, `admin-units/`). But an
entity that is a *structural part* of another — an organization's units and
groups (`org:unitOf` / `org:hasSubOrganization`) — nests under that parent's
document URI, so the path mirrors the RDF composition
(`organizations/lietuvos-respublikos-seimas/org-units/{id}/`). This is the
only case URI depth encodes hierarchy; membership and other relationships
are *not* composition and never nest (a person is a *member* of the Seimas,
not a part of it, so `persons/` stays top-level). The same pattern applies
to any future organization with internal structure (a ministry, a court).
**Precondition — the parent must be fixed and derivable from the child's
key.** Nesting only preserves principle 3 (mint a link from a bare foreign
key) when every instance has the *same, well-known* parent, so `{key}` plus a
constant prefix yields the URI with no lookup. The Seimas qualifies: every
org-unit belongs to the one Seimas. Admin units do **not** — a settlement's
eldership (and a municipality's county) is not encoded in its AR code
(municipality `12` is in county `2`, `13` in county `10`; settlement `23643`
in eldership `1867`), so a partonomy path like
`admin-units/{county}/…/{gyv_kodas}/` would demand a per-entity ancestry
lookup and would churn under municipal reforms. Also do not encode class
*subsumption* in the path (`rdf:type` + `rdfs:subClassOf` already carry it,
and an instance's most-specific class is mutable). Such part-of and is-a
hierarchies stay in the RDF (`dct:isPartOf`, `rdf:type`) and the 1:N views,
never in the path — `admin-units/` and `streets/` are flat.
3. **Natural keys as slugs**: official codes from the source registry, never
name-derived strings (except parties, see below). Any pipeline can mint a
link from a bare foreign key without looking up the target dataset.
Expand All @@ -32,9 +55,9 @@ the committed outputs under `datasets/current/` use the default
| `admin-units/{code}/` | AR code: county `adm_kodas` (1 digit), municipality `sav_kodas` (2), eldership `sen_kodas` (4), settlement `gyv_kodas` (5) — ranges verified non-colliding | `cv:AdminUnit` | AR via get.data.gov.lt |
| `streets/{gat_kodas}/` | AR street code (7 digits) | `dct:Location` | AR |
| `persons/{asmens_id}/` | Seimas person id | `foaf:Person` | apps.lrs.lt |
| `org-units/{padalinio_id}/` | Seimas structural-unit id | `org:OrganizationalUnit` | apps.lrs.lt |
| `parliamentary-groups/{grupes_id}/` | Seimas parliamentary-group id (separate id space from `padalinio_id`) | `org:OrganizationalUnit` | apps.lrs.lt |
| `organizations/{slug}/` | name slug (no natural key in source) | `org:FormalOrganization` | e.g. `organizations/lietuvos-respublikos-seimas/` |
| `organizations/{slug}/` | name slug (no natural key in source) | `org:FormalOrganization` | `organizations/lietuvos-respublikos-seimas/` — a **container** (its parts nest under it, see below) that is also the org entity |
| `organizations/lietuvos-respublikos-seimas/org-units/{padalinio_id}/` | Seimas structural-unit id | `org:OrganizationalUnit` | apps.lrs.lt (nested under the Seimas via `org:unitOf`) |
| `organizations/lietuvos-respublikos-seimas/groups/{grupes_id}/` | Seimas parliamentary-group id (separate id space from `padalinio_id`) | `org:OrganizationalUnit` | apps.lrs.lt (nested under the Seimas) |
| `parties/{slug}/` | transliterated party-name slug (JAR code once matched — parties keep slug for continuity, `owl:sameAs`/`dct:identifier` carry the code) | `org:FormalOrganization` | apps.lrs.lt (VRK/JAR later) |
| `legal-entities/{ja_kodas}/` | JAR company code (9 digits) | `rov:RegisteredOrganization` | JAR via get.data.gov.lt |
| `taxonomies/{scheme}/` | scheme slug | `skos:ConceptScheme` | — |
Expand Down
40 changes: 20 additions & 20 deletions etl/queries/EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,12 @@ Rezultatai:
|---|---|---|---|
| http://purl.org/dc/terms/Location | 61149 | 0 | 0 |
| http://data.europa.eu/m8g/AdminUnit | 26883 | 642 | 456 |
| http://www.w3.org/ns/org#FormalOrganization | 6037 | 0 | 0 |
| http://www.w3.org/ns/org#FormalOrganization | 6036 | 0 | 0 |
| http://www.w3.org/ns/regorg#RegisteredOrganization | 6025 | 0 | 0 |
| http://www.w3.org/2004/02/skos/core#Concept | 257 | 0 | 0 |
| http://xmlns.com/foaf/0.1/Person | 148 | 101 | 148 |
| http://xmlns.com/foaf/0.1/Person | 148 | 100 | 148 |
| http://www.w3.org/ns/org#OrganizationalUnit | 136 | 0 | 0 |
| http://www.w3.org/2004/02/skos/core#ConceptScheme | 7 | 0 | 0 |
| https://schema.org/PoliticalParty | 11 | 0 | 0 |


## CONSTRUCT: frakcijų seniūnų profiliai
Expand Down Expand Up @@ -419,32 +419,32 @@ Rezultatai:

| subjektas (S) | predikatas (P) | objektas (O) |
|---|---|---|
| <https://linkeddata.lt/org-units/1022/#this> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://schema.org/Organization> |
| <https://linkeddata.lt/org-units/1022/#this> | <https://schema.org/name> | "Tėvynės sąjungos-Lietuvos krikščionių demokratų frakcija"@lt |
| <https://linkeddata.lt/org-units/1070/#this> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://schema.org/Organization> |
| <https://linkeddata.lt/org-units/1070/#this> | <https://schema.org/name> | "Lietuvos valstiečių, žaliųjų ir Krikščioniškų šeimų sąjungos frakcija"@lt |
| <https://linkeddata.lt/org-units/1322/#this> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://schema.org/Organization> |
| <https://linkeddata.lt/org-units/1322/#this> | <https://schema.org/name> | "Demokratų frakcija „Vardan Lietuvos“"@lt |
| <https://linkeddata.lt/org-units/1430/#this> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://schema.org/Organization> |
| <https://linkeddata.lt/org-units/1430/#this> | <https://schema.org/name> | "„Nemuno aušros“ frakcija"@lt |
| <https://linkeddata.lt/org-units/47/#this> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://schema.org/Organization> |
| <https://linkeddata.lt/org-units/47/#this> | <https://schema.org/name> | "Mišri Seimo narių grupė"@lt |
| <https://linkeddata.lt/org-units/793/#this> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://schema.org/Organization> |
| <https://linkeddata.lt/org-units/793/#this> | <https://schema.org/name> | "Lietuvos socialdemokratų partijos frakcija"@lt |
| <https://linkeddata.lt/org-units/870/#this> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://schema.org/Organization> |
| <https://linkeddata.lt/org-units/870/#this> | <https://schema.org/name> | "Liberalų sąjūdžio frakcija"@lt |
| <https://linkeddata.lt/organizations/lietuvos-respublikos-seimas/org-units/1022/#this> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://schema.org/Organization> |
| <https://linkeddata.lt/organizations/lietuvos-respublikos-seimas/org-units/1022/#this> | <https://schema.org/name> | "Tėvynės sąjungos-Lietuvos krikščionių demokratų frakcija"@lt |
| <https://linkeddata.lt/organizations/lietuvos-respublikos-seimas/org-units/1070/#this> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://schema.org/Organization> |
| <https://linkeddata.lt/organizations/lietuvos-respublikos-seimas/org-units/1070/#this> | <https://schema.org/name> | "Lietuvos valstiečių, žaliųjų ir Krikščioniškų šeimų sąjungos frakcija"@lt |
| <https://linkeddata.lt/organizations/lietuvos-respublikos-seimas/org-units/1322/#this> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://schema.org/Organization> |
| <https://linkeddata.lt/organizations/lietuvos-respublikos-seimas/org-units/1322/#this> | <https://schema.org/name> | "Demokratų frakcija „Vardan Lietuvos“"@lt |
| <https://linkeddata.lt/organizations/lietuvos-respublikos-seimas/org-units/1430/#this> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://schema.org/Organization> |
| <https://linkeddata.lt/organizations/lietuvos-respublikos-seimas/org-units/1430/#this> | <https://schema.org/name> | "„Nemuno aušros“ frakcija"@lt |
| <https://linkeddata.lt/organizations/lietuvos-respublikos-seimas/org-units/47/#this> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://schema.org/Organization> |
| <https://linkeddata.lt/organizations/lietuvos-respublikos-seimas/org-units/47/#this> | <https://schema.org/name> | "Mišri Seimo narių grupė"@lt |
| <https://linkeddata.lt/organizations/lietuvos-respublikos-seimas/org-units/793/#this> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://schema.org/Organization> |
| <https://linkeddata.lt/organizations/lietuvos-respublikos-seimas/org-units/793/#this> | <https://schema.org/name> | "Lietuvos socialdemokratų partijos frakcija"@lt |
| <https://linkeddata.lt/organizations/lietuvos-respublikos-seimas/org-units/870/#this> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://schema.org/Organization> |
| <https://linkeddata.lt/organizations/lietuvos-respublikos-seimas/org-units/870/#this> | <https://schema.org/name> | "Liberalų sąjūdžio frakcija"@lt |
| <https://linkeddata.lt/persons/12253/#this> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://schema.org/Person> |
| <https://linkeddata.lt/persons/12253/#this> | <https://schema.org/image> | <https://www.lrs.lt/SIPIS/sn_foto/2024/jaroslav_narkevic.jpg> |
| <https://linkeddata.lt/persons/12253/#this> | <https://schema.org/memberOf> | <https://linkeddata.lt/org-units/1070/#this> |
| <https://linkeddata.lt/persons/12253/#this> | <https://schema.org/memberOf> | <https://linkeddata.lt/organizations/lietuvos-respublikos-seimas/org-units/1070/#this> |
| <https://linkeddata.lt/persons/12253/#this> | <https://schema.org/name> | "Jaroslav Narkevič" |
| <https://linkeddata.lt/persons/15266/#this> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://schema.org/Person> |
| <https://linkeddata.lt/persons/15266/#this> | <https://schema.org/image> | <https://www.lrs.lt/SIPIS/sn_foto/2024/orinta_leipute.jpg> |
| <https://linkeddata.lt/persons/15266/#this> | <https://schema.org/memberOf> | <https://linkeddata.lt/org-units/793/#this> |
| <https://linkeddata.lt/persons/15266/#this> | <https://schema.org/memberOf> | <https://linkeddata.lt/organizations/lietuvos-respublikos-seimas/org-units/793/#this> |
| <https://linkeddata.lt/persons/15266/#this> | <https://schema.org/name> | "Orinta Leiputė" |
| <https://linkeddata.lt/persons/15266/#this> | <https://schema.org/sameAs> | <http://www.wikidata.org/entity/Q1750302> |
| <https://linkeddata.lt/persons/64701/#this> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://schema.org/Person> |
| <https://linkeddata.lt/persons/64701/#this> | <https://schema.org/image> | <https://www.lrs.lt/SIPIS/sn_foto/2024/laurynas_kasciunas.jpg> |
| <https://linkeddata.lt/persons/64701/#this> | <https://schema.org/memberOf> | <https://linkeddata.lt/org-units/1022/#this> |
| <https://linkeddata.lt/persons/64701/#this> | <https://schema.org/memberOf> | <https://linkeddata.lt/organizations/lietuvos-respublikos-seimas/org-units/1022/#this> |
| <https://linkeddata.lt/persons/64701/#this> | <https://schema.org/name> | "Laurynas Kasčiūnas" |
| <https://linkeddata.lt/persons/64701/#this> | <https://schema.org/sameAs> | <http://www.wikidata.org/entity/Q28735068> |
| <https://linkeddata.lt/persons/65703/#this> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <https://schema.org/Person> |
Expand Down
32 changes: 11 additions & 21 deletions etl/seimas/mappings/org-units.rq
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Seimas structural units (factions, committees, commissions) and parliamentary
# groups as org:OrganizationalUnit, one per named graph; plus the Seimas itself.
# Structural units come from the dedicated feeds; parliamentary groups are only
# present in the members feed's position rows, so both normalized inputs are used.
PREFIX cv: <http://data.europa.eu/m8g/>
# groups as org:OrganizationalUnit, one per named graph, nested under the Seimas
# organization document (organizations/lietuvos-respublikos-seimas/). Structural
# units come from the dedicated feeds; parliamentary groups are only present in
# the members feed's position rows, so both normalized inputs are used. The
# Seimas organization document itself is app/ scaffolding, not ETL output — the
# units only reference it via org:unitOf.
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX org: <http://www.w3.org/ns/org#>
Expand All @@ -13,16 +15,6 @@ PREFIX sioc: <http://rdfs.org/sioc/ns#>

CONSTRUCT
{
GRAPH ?seimasGraph
{
?seimasGraph a dh:Item ;
sioc:has_container ?organizations ;
dct:title "Lietuvos Respublikos Seimas"@lt ;
foaf:primaryTopic ?seimas .
?seimas a org:FormalOrganization, cv:PublicOrganisation ;
skos:prefLabel "Lietuvos Respublikos Seimas"@lt, "Seimas of the Republic of Lithuania"@en ;
foaf:homepage <https://www.lrs.lt/> .
}
GRAPH ?graph
{
?graph a dh:Item ;
Expand All @@ -40,23 +32,21 @@ CONSTRUCT
}
WHERE
{
BIND(uri(concat(str($base), "organizations/")) AS ?organizations)
BIND(uri(concat(str(?organizations), "lietuvos-respublikos-seimas/")) AS ?seimasGraph)
BIND(uri(concat(str(?seimasGraph), "#this")) AS ?seimas)
BIND(uri(concat(str($base), "organizations/lietuvos-respublikos-seimas/#this")) AS ?seimas)

{
?row <#padalinio_id> ?id ;
<#pavadinimas> ?name ;
<#tipas> ?tipas .
OPTIONAL { ?row <#santrumpa> ?abbr }
BIND(uri(concat(str($base), "org-units/", encode_for_uri(?id), "/")) AS ?graph)
BIND(uri(concat(str($base), "organizations/lietuvos-respublikos-seimas/org-units/", encode_for_uri(?id), "/")) AS ?graph)
BIND(?tipas AS ?typeSlug)
}
UNION
{
?row <#parlamentines_grupes_id> ?id ;
<#parlamentines_grupes_pavadinimas> ?name .
BIND(uri(concat(str($base), "parliamentary-groups/", encode_for_uri(?id), "/")) AS ?graph)
BIND(uri(concat(str($base), "organizations/lietuvos-respublikos-seimas/groups/", encode_for_uri(?id), "/")) AS ?graph)
BIND("parlamentine-grupe" AS ?typeSlug)
}
UNION
Expand All @@ -67,7 +57,7 @@ WHERE
?row <#padalinio_id> ?id ;
<#padalinio_pavadinimas> ?name .
FILTER NOT EXISTS { ?row <#tipas> ?anyType }
BIND(uri(concat(str($base), "org-units/", encode_for_uri(?id), "/")) AS ?graph)
BIND(uri(concat(str($base), "organizations/lietuvos-respublikos-seimas/org-units/", encode_for_uri(?id), "/")) AS ?graph)
BIND(IF(CONTAINS(lcase(?name), "komisij"), "komisija",
IF(CONTAINS(lcase(?name), "komitet"), "komitetas",
IF(CONTAINS(lcase(?name), "frakcij"), "frakcija",
Expand All @@ -77,7 +67,7 @@ WHERE
BIND(STRLANG(?name, "lt") AS ?title)
BIND(IF(BOUND(?abbr), STRLANG(?abbr, "lt"), ?undef) AS ?abbreviation)
BIND(uri(concat(str(?graph), "#this")) AS ?unit)
# container = graph URI minus the slug segment (org-units/ or parliamentary-groups/)
# container = graph URI minus the slug segment (…/org-units/ or …/groups/)
BIND(uri(replace(str(?graph), "[^/]+/$", "")) AS ?container)
BIND(uri(concat(str($base), "taxonomies/org-unit-types/", ?typeSlug, "/#this")) AS ?typeConcept)
}
4 changes: 2 additions & 2 deletions etl/seimas/mappings/persons.rq
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ WHERE
OPTIONAL { ?prow <#pareigos_nuo> ?mFromRaw }
OPTIONAL { ?prow <#pareigos_iki> ?mToRaw }
}
BIND(IF(BOUND(?unitId), uri(concat(str($base), "org-units/", encode_for_uri(?unitId), "/#this")), ?undef) AS ?unit)
BIND(IF(BOUND(?unitId), uri(concat(str($base), "organizations/lietuvos-respublikos-seimas/org-units/", encode_for_uri(?unitId), "/#this")), ?undef) AS ?unit)
BIND(IF(BOUND(?roleSlug) && BOUND(?unitId), uri(concat(str($base), "taxonomies/position-types/", ?roleSlug, "/#this")), ?undef) AS ?role)
BIND(IF(BOUND(?unitId), uri(concat(str(?graph), "#membership-", encode_for_uri(?unitId), "-",
REPLACE(COALESCE(?mFromRaw, ""), "-", ""))), ?undef) AS ?membership)
Expand All @@ -139,7 +139,7 @@ WHERE
OPTIONAL { ?grow <#pareigos_nuo> ?pgFromRaw }
OPTIONAL { ?grow <#pareigos_iki> ?pgToRaw }
}
BIND(IF(BOUND(?groupId), uri(concat(str($base), "parliamentary-groups/", encode_for_uri(?groupId), "/#this")), ?undef) AS ?pgroup)
BIND(IF(BOUND(?groupId), uri(concat(str($base), "organizations/lietuvos-respublikos-seimas/groups/", encode_for_uri(?groupId), "/#this")), ?undef) AS ?pgroup)
BIND(IF(BOUND(?pgRoleSlug) && BOUND(?groupId), uri(concat(str($base), "taxonomies/position-types/", ?pgRoleSlug, "/#this")), ?undef) AS ?pgRole)
BIND(IF(BOUND(?groupId), uri(concat(str(?graph), "#pg-membership-", encode_for_uri(?groupId), "-",
REPLACE(COALESCE(?pgFromRaw, ""), "-", ""))), ?undef) AS ?pgMembership)
Expand Down
Loading
Loading