Skip to content

Commit

Permalink
Merge pull request #565 from EBISPOT/502
Browse files Browse the repository at this point in the history
  • Loading branch information
henrietteharmse authored Nov 2, 2023
2 parents 1fc01d7 + da5bfe3 commit c42c01d
Show file tree
Hide file tree
Showing 4 changed files with 9,996 additions and 3 deletions.
15 changes: 12 additions & 3 deletions frontend/src/model/Entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ export default abstract class Entity extends Thing {
);
}

isPredicateFromInformalVocabulary(predicate: string): boolean {
return predicate.startsWith("http://www.w3.org/2004/02/skos/core#") ||
predicate.startsWith("http://purl.org/dc/terms/") ||
predicate.startsWith("http://purl.org/dc/elements/1.1/") ||
predicate.startsWith("http://schema.org/")
}
getAnnotationPredicates(): string[] {
let definitionProperties = asArray(this.properties["definitionProperty"]);
let synonymProperties = asArray(this.properties["synonymProperty"]);
Expand All @@ -107,9 +113,12 @@ export default abstract class Entity extends Thing {
if (predicate === "http://xmlns.com/foaf/0.1/depicted_by") continue;
if (predicate === "http://xmlns.com/foaf/0.1/depiction") continue;

let linkedEntity = this.getLinkedEntities().get(predicate)
if (linkedEntity != undefined && linkedEntity.type.indexOf("objectProperty") !== -1) continue;
if (linkedEntity != undefined && linkedEntity.type.indexOf("dataProperty") !== -1) continue;
// Object properties and data properties are not annotation properties, except in the case of informal vocabularies.
if (!this.isPredicateFromInformalVocabulary(predicate)) {
let linkedEntity = this.getLinkedEntities().get(predicate)
if (linkedEntity != undefined && linkedEntity.type.indexOf("objectProperty") !== -1) continue;
if (linkedEntity != undefined && linkedEntity.type.indexOf("dataProperty") !== -1) continue;
}

// If the value was already interpreted as definition/synonym/hierarchical, do
// not include it as an annotation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ export default function IndividualPropertyAssertionsSection({
}
}


if (!propertyAssertions || propertyAssertions.length === 0) {
return <Fragment />;
}

return (
<div>
<div className="font-bold">Property assertions</div>
Expand Down
24 changes: 24 additions & 0 deletions testcases/annotation-properties/gitIssue502.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"ontologies": [
{
"id": "rdfs",
"ontology_purl": "https://www.w3.org/2000/01/rdf-schema",
"base_uri": ["http://www.w3.org/2000/01/rdf-schema#"]
},
{
"id": "owl",
"ontology_purl": "https://www.w3.org/2002/07/owl",
"base_uri": ["http://www.w3.org/2002/07/owl#"]
},
{
"id": "skos",
"ontology_purl": "http://www.w3.org/TR/skos-reference/skos.rdf",
"base_uri": ["http://www.w3.org/2004/02/skos/core#"]
},
{
"id": "gitIssue502",
"preferredPrefix": "gitIssue502",
"ontology_purl": "./testcases/annotation-properties/gitIssue502.owl"
}
]
}
Loading

0 comments on commit c42c01d

Please sign in to comment.