Skip to content

Pleiades as a Source#241

Open
wjbmattingly wants to merge 7 commits intomainfrom
pleiades-test
Open

Pleiades as a Source#241
wjbmattingly wants to merge 7 commits intomainfrom
pleiades-test

Conversation

@wjbmattingly
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread pipeline/sources/pleiades/mapper.py Outdated
uri = f"https://pleiades.stoa.org/vocabularies/{concept_id}"

# Extract prefLabel
label_match = re.search(r'skos:prefLabel "([^"]+)"@en', ttl_section)
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread pipeline/sources/pleiades/mapper.py Outdated
label = label_match.group(1)

# Extract scopeNote (description)
scope_match = re.search(r'skos:scopeNote "([^"]+)"@en', ttl_section)
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread pipeline/sources/pleiades/mapper.py Outdated
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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread pipeline/sources/pleiades/mapper.py Outdated
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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread pipeline/sources/pleiades/mapper.py Outdated
return {"identifier": recid, "data": data, "source": "pleiades"}

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

Copy link
Copy Markdown
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
Copy Markdown
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.

2 participants