Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed soa:Geo class representation #80

Merged
merged 4 commits into from
May 27, 2024
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
21 changes: 8 additions & 13 deletions ontologies/semopenalex-ontology-shacl.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<https://orcid.org/0009-0009-4338-0983>;
dct:issued "2022-05-12"^^xsd:date;
dct:license <http://creativecommons.org/publicdomain/zero/1.0/>;
dct:modified "2023-10-24"^^xsd:date;
dct:modified "2024-05-24"^^xsd:date;
dct:publisher <http://dbpedia.org/resource/Karlsruhe_Institute_of_Technology>, <http://www.wikidata.org/entity/Q22132500>;
dct:title "SemOpenAlex Ontology"@en;
rdfs:comment "The Semantic OpenAlex Ontology, described using W3C RDF Schema and the Web Ontology Language OWL."@en;
Expand Down Expand Up @@ -45,7 +45,7 @@
rdfs:label "Linn Aung";
foaf:mbox <mailto:[email protected]> .

<http://dbpedia.org/ontology/location> a owl:ObjectProperty;
<https://dbpedia.org/ontology/location> a owl:ObjectProperty;
rdfs:isDefinedBy <https://semopenalex.org/ontology/> .

<http://prismstandard.org/namespaces/basic/2.0/doi> a owl:DatatypeProperty;
Expand Down Expand Up @@ -191,7 +191,7 @@ soa:013f2f63f0b01681bb2b6bee1410bea9 a sh:PropertyShape;

soa:031c9716dcc41536893fe766a943dca2 a sh:PropertyShape;
sh:datatype xsd:string;
sh:path <http://www.geonames.org/ontology#countryCode> .
sh:path <https://dbpedia.org/property/countryCode> .

soa:0505f27824e6216f6cefdbd4e005817d a sh:PropertyShape .

Expand Down Expand Up @@ -225,7 +225,7 @@ soa:0d30180e88607a9b9f3e7efdf6a5a920 a sh:PropertyShape;

soa:1332c0bb9ba85ee3d259b28b69384e8d a sh:PropertyShape;
sh:datatype xsd:float;
sh:path <http://www.geonames.org/ontology#lat> .
sh:path <http://www.w3.org/2003/01/geo/wgs84_pos#lat> .

soa:189d841b1771b070e525aa80a66987e5 a sh:PropertyShape;
sh:class soa:Source;
Expand All @@ -237,7 +237,7 @@ soa:1bb749c62c841583be769092b22db6b8 a sh:PropertyShape;

soa:1c15feb6789e3ab6b591b6963f5fabd8 a sh:PropertyShape;
sh:datatype xsd:float;
sh:path <http://www.geonames.org/ontology#long> .
sh:path <http://www.w3.org/2003/01/geo/wgs84_pos#long> .

soa:2183731b5316d244e42f7f4bb5d53178 a sh:PropertyShape .

Expand Down Expand Up @@ -518,9 +518,8 @@ soa:Geo a owl:Class;
rdfs:label "Geo"@en .

soa:GeoShape a sh:NodeShape;
sh:property soa:031c9716dcc41536893fe766a943dca2, soa:1332c0bb9ba85ee3d259b28b69384e8d,
soa:1c15feb6789e3ab6b591b6963f5fabd8, soa:2b3c29e0b34e9bc29556f5229eb14a97, soa:6ea4e05d3608eb027517e565a2f1103c,
soa:e38f3b3c38e508f7aa6cceb7394b6c8b, soa:eb7e6709e5e9634bfcc6232b56028bce;
sh:property soa:031c9716dcc41536893fe766a943dca2, soa:1332c0bb9ba85ee3d259b28b69384e8d, soa:2b3c29e0b34e9bc29556f5229eb14a97,
soa:1c15feb6789e3ab6b591b6963f5fabd8, soa:eb7e6709e5e9634bfcc6232b56028bce, soa:6ea4e05d3608eb027517e565a2f1103c ;
sh:targetClass soa:Geo .

soa:HostVenueShape a sh:NodeShape;
Expand Down Expand Up @@ -842,13 +841,9 @@ soa:ddcebb3ed512f8f49c20e7d8d168d087 a sh:PropertyShape;
sh:datatype xsd:string;
sh:path soa:umlsAui .

soa:e38f3b3c38e508f7aa6cceb7394b6c8b a sh:PropertyShape;
sh:datatype xsd:string;
sh:path <http://www.geonames.org/ontology#geonamesID> .

soa:e6d6f1fbf0cd5a66ac9208072882dea6 a sh:PropertyShape;
sh:class soa:Geo;
sh:path <http://dbpedia.org/ontology/location> .
sh:path <https://dbpedia.org/ontology/location> .

soa:e87cdd7b584967125d063d517eed6e4e a sh:PropertyShape;
sh:class soa:Author;
Expand Down
16 changes: 5 additions & 11 deletions ontologies/semopenalex-ontology.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
rdfs:label "SemOpenAlex Ontology"@en;
rdfs:comment "The Semantic OpenAlex Ontology, described using W3C RDF Schema and the Web Ontology Language OWL."@en ;
dcterms:created "2022-05-12"^^xsd:date ;
dcterms:modified "2023-10-24"^^xsd:date ;
dcterms:modified "2024-05-24"^^xsd:date ;
dcterms:license <http://creativecommons.org/publicdomain/zero/1.0/> ;
dcterms:issued "2023-10-18"^^xsd:date ;
dcterms:publisher <http://dbpedia.org/resource/Karlsruhe_Institute_of_Technology> ;
Expand Down Expand Up @@ -262,7 +262,7 @@ foaf:name a owl:DatatypeProperty;
rdfs:label "OpenAccess"@en ;
rdfs:comment "This class represents an open access status."@en.

<http://dbpedia.org/ontology/location> a owl:ObjectProperty;
<https://dbpedia.org/ontology/location> a owl:ObjectProperty;
rdfs:domain <https://semopenalex.org/ontology/Institution>;
rdfs:range <https://semopenalex.org/ontology/Geo> ;
rdfs:comment "This property specifies the location of an institution."@en;
Expand Down Expand Up @@ -606,31 +606,25 @@ foaf:name a owl:DatatypeProperty;
rdfs:comment "This property specifies the city of a geo."@en;
rdfs:label "city"@en .

<http://www.geonames.org/ontology#geonamesID> a owl:DatatypeProperty;
rdfs:domain <https://semopenalex.org/ontology/Geo>;
rdfs:range xsd:string ;
rdfs:comment "This property specifies the geonames ID of a geo."@en;
rdfs:label "geonames ID"@en .

<https://dbpedia.org/property/region> a owl:DatatypeProperty;
rdfs:domain <https://semopenalex.org/ontology/Geo>;
rdfs:range xsd:string ;
rdfs:comment "This property specifies the region of a geo."@en;
rdfs:label "region"@en .

<http://www.geonames.org/ontology#countryCode> a owl:DatatypeProperty;
<https://dbpedia.org/property/countryCode> a owl:DatatypeProperty;
rdfs:domain <https://semopenalex.org/ontology/Geo>;
rdfs:range xsd:string ;
rdfs:comment "This property specifies the country code of a geo."@en;
rdfs:label "country code"@en .

<http://www.geonames.org/ontology#lat> a owl:DatatypeProperty;
<http://www.w3.org/2003/01/geo/wgs84_pos#lat> a owl:DatatypeProperty;
rdfs:domain <https://semopenalex.org/ontology/Geo>;
rdfs:range xsd:float ;
rdfs:comment "This property specifies the latitude of a geo."@en;
rdfs:label "latitude"@en .

<http://www.geonames.org/ontology#long> a owl:DatatypeProperty;
<http://www.w3.org/2003/01/geo/wgs84_pos#long> a owl:DatatypeProperty;
rdfs:domain <https://semopenalex.org/ontology/Geo>;
rdfs:range xsd:float ;
rdfs:comment "This property specifies the longitude of a geo."@en;
Expand Down
3 changes: 3 additions & 0 deletions semopenalex-app/config/namespaces.prop
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ dct = http://purl.org/dc/terms/
foaf = http://xmlns.com/foaf/0.1/
fabio = http://purl.org/spar/fabio/
soa = https://semopenalex.org/ontology/
wgs = http://www.w3.org/2003/01/geo/wgs84_pos#
dbpedia-owl = https://dbpedia.org/ontology/
dbprop = https://dbpedia.org/property/
23 changes: 11 additions & 12 deletions transformation-scripts/semopenalex-institutions.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ def clean_url(nameStr):
city_predicate = URIRef("https://dbpedia.org/property/city")
region_predicate = URIRef("https://dbpedia.org/property/region")
country_predicate = URIRef("https://dbpedia.org/property/country")
country_code_geo_predicate = URIRef("http://www.geonames.org/ontology#countryCode")
lat_geo_predicate = URIRef("http://www.geonames.org/ontology#lat")
long_geo_predicate = URIRef("http://www.geonames.org/ontology#long")
country_code_geo_predicate = URIRef("https://dbpedia.org/property/countryCode")
lat_geo_predicate = URIRef("http://www.w3.org/2003/01/geo/wgs84_pos#lat")
long_geo_predicate = URIRef("http://www.w3.org/2003/01/geo/wgs84_pos#long")
associated_institution_predicate = URIRef("https://semopenalex.org/ontology/hasAssociatedInstitution")
year_predicate = URIRef("https://semopenalex.org/ontology/year")

Expand Down Expand Up @@ -302,22 +302,18 @@ def clean_url(nameStr):
if not geo_city is None:
institutions_graph.add((geo_uri,city_predicate,Literal(geo_city,datatype=XSD.string)))

geo_country_code = institution_geo['country_code']
if not geo_country_code is None:
institutions_graph.add((geo_uri,country_code_geo_predicate,Literal(geo_country_code,datatype=XSD.string)))

geo_geonames_city_id = institution_geo['geonames_city_id']
if not geo_geonames_city_id is None:
institutions_graph.add((geo_uri,geoname_id_predicate,Literal(geo_geonames_city_id,datatype=XSD.string)))
institutions_graph.add((geo_uri, OWL.sameAs, URIRef('https://sws.geonames.org/' + geo_geonames_city_id)))

geo_region = institution_geo['region']
if not geo_region is None:
institutions_graph.add((geo_uri,region_predicate,Literal(geo_region,datatype=XSD.string)))

geo_country_code = institution_geo['country_code']
if not geo_country_code is None:
institutions_graph.add((geo_uri,country_code_geo_predicate,Literal(geo_country_code,datatype=XSD.string)))

geo_country = institution_geo['country']
if not geo_country is None:
institutions_graph.add((geo_uri,country_predicate,Literal(geo_country,datatype=XSD.string)))

geo_latitude = institution_geo['latitude']
if not geo_latitude is None:
institutions_graph.add((geo_uri,lat_geo_predicate,Literal(geo_latitude,datatype=XSD.float)))
Expand All @@ -326,6 +322,9 @@ def clean_url(nameStr):
if not geo_longitude == None:
institutions_graph.add((geo_uri,long_geo_predicate,Literal(geo_longitude,datatype=XSD.float)))

geo_country = institution_geo['country']
if not geo_country is None:
institutions_graph.add((geo_uri,country_predicate,Literal(geo_country,datatype=XSD.string)))

#international
#to do
Expand Down