Skip to content

Conversation

@wjbmattingly
Copy link
Contributor

This PR brings Pleiades into Lux as a source of data for place names. It also allows us to understand hierarchical data for places via connections.

Copy link
Collaborator

@azaroth42 azaroth42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor comments, the language one is the only truly substantive

t = geom.get("type")
coords = geom.get("coordinates")
if t == "Point":
return f"POINT ({coords[0]} {coords[1]})"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about this? Could be [1] [0]?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double checked a week ago and it's right, I believe.

uri = f"https://pleiades.stoa.org/vocabularies/{concept_id}"

# Extract prefLabel
label_match = re.search(r'skos:prefLabel "([^"]+)"@en', ttl_section)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all preflabels in English?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

label = label_match.group(1)

# Extract scopeNote (description)
scope_match = re.search(r'skos:scopeNote "([^"]+)"@en', ttl_section)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And ditto scope notes. Would be better to trap @.. and then add the equivalent Language to the name / statement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if primary_name_data["language"] == "en":
primary_name.language = model.Language(ident="http://vocab.getty.edu/aat/300388277") # English
else:
primary_name.language = model.Language(label=primary_name_data["language"])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should look up the language in two_to_three on Mapper.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if name_data["language"] == "en":
alt_name.language = model.Language(ident="http://vocab.getty.edu/aat/300388277") # English
else:
alt_name.language = model.Language(label=name_data["language"])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto -- no point having a language without a URI, but we have a good alignment table.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return {"identifier": recid, "data": data, "source": "pleiades"}

def transform(self, record, rectype, reference=False):

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not rectype:
rectype = self.guess_type(record)

Copy link
Contributor Author

@wjbmattingly wjbmattingly Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants