Skip to content

Commit

Permalink
Fix domain/ranges of dbpedia property dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
Binh Vu committed Mar 29, 2024
1 parent 66d63ea commit 9f64836
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- Add `entity_types` db

### Fixed

- Fix domain/ranges of dbpedia property dataset

## [7.1.0] (2024-03-28)

### Added
Expand Down
4 changes: 2 additions & 2 deletions kgdata/dbpedia/datasets/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ def to_prop(resource: RDFResource, default_lang: str = "en") -> OntologyProperty
description.lang = default_lang
description.lang2value[default_lang] = ""

domains = None
domains = []
if rdfs_domain in resource.props:
domains = [str(term) for term in resource.props.get(rdfs_domain, [])]

ranges = None
ranges = []
if (
OWL.ObjectProperty in resource.props.get(rdf_type, [])
and rdfs_range in resource.props
Expand Down
1 change: 1 addition & 0 deletions kgdata/models/ont_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class OntologyProperty:
datatype: str
instanceof: list[str]
parents: list[str]
# do not include the property itself
ancestors: dict[str, int]
inverse_properties: list[str]
related_properties: list[str]
Expand Down
1 change: 1 addition & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ wikidata_dataset properties
# dbpedia_db classes
dbpedia_db properties
# dbpedia_db entities
# dbpedia_db entity_types
# dbpedia_db entity_labels
# dbpedia_db entity_metadata
# dbpedia_db entity_redirections
Expand Down

0 comments on commit 9f64836

Please sign in to comment.