Skip to content

Commit

Permalink
remove more stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
BalduinLandolt committed Mar 20, 2024
1 parent a8ef807 commit 978a507
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 60 deletions.
4 changes: 0 additions & 4 deletions scripts/v2-test-data-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
"source": "/v2/ontologies/anything-ontology.json",
"destination": "./test/data/api/v2/ontologies/anything-ontology.json"
},
{
"source": "/v2/ontologies//minimal-ontology.json",
"destination": "./test/data/api/v2/ontologies/minimal-ontology.json"
},
{
"source": "/v2/ontologies/incunabula-ontology.json",
"destination": "./test/data/api/v2/ontologies/incunabula-ontology.json"
Expand Down
50 changes: 0 additions & 50 deletions src/api/v2/ontology/ontologies-endpoint.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,56 +188,6 @@ describe("OntologiesEndpoint", () => {

});

it("should return a very simple project ontology", done => {

knoraApiConnection.v2.onto.getOntology("http://0.0.0.0:3333/ontology/0001/minimal/v2").subscribe(
(response: ReadOntology) => {

expect(response.id).toEqual("http://0.0.0.0:3333/ontology/0001/minimal/v2");
expect(response.label).toEqual("A minimal ontology");

expect(response.dependsOnOntologies.size).toEqual(1);
expect(response.dependsOnOntologies.has("http://api.knora.org/ontology/knora-api/v2")).toBeTruthy();

done();
});

const request = jasmine.Ajax.requests.mostRecent();

const onto = require("../../../../test/data/api/v2/ontologies/minimal-ontology.json");

request.respondWith(MockAjaxCall.mockResponse(JSON.stringify(onto)));

expect(request.url).toBe("http://0.0.0.0:3333/v2/ontologies/allentities/http%3A%2F%2F0.0.0.0%3A3333%2Fontology%2F0001%2Fminimal%2Fv2");

expect(request.method).toEqual("GET");

});

it("should return an ontology with labels and comments in all languages", done => {

knoraApiConnection.v2.onto.getOntology("http://0.0.0.0:3333/ontology/0001/minimal/v2", true).subscribe(
(response: ReadOntology) => {

expect(response.getPropertyDefinitionsByType(ResourcePropertyDefinitionWithAllLanguages).length).toEqual(1);

expect(response.getPropertyDefinitionsByType(ResourcePropertyDefinitionWithAllLanguages)[0].labels[0].value).toEqual("has name");

done();
});

const request = jasmine.Ajax.requests.mostRecent();

const onto = require("../../../../test/data/api/v2/manually-generated/minimal-ontology-with-all-languages-expanded.json");

request.respondWith(MockAjaxCall.mockResponse(JSON.stringify(onto)));

expect(request.url).toBe("http://0.0.0.0:3333/v2/ontologies/allentities/http%3A%2F%2F0.0.0.0%3A3333%2Fontology%2F0001%2Fminimal%2Fv2?allLanguages=true");

expect(request.method).toEqual("GET");

});

});

describe("Method getOntologiesByProjectIri", () => {
Expand Down
7 changes: 1 addition & 6 deletions test/data/api/v2/mock-ontology.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { StandoffClassDefinition } from "../../../../src/models/v2/ontologies/st
import { SystemPropertyDefinition } from "../../../../src/models/v2/ontologies/system-property-definition";
import ontologiesMetadata from "../v2/ontologies/all-ontology-metadata-response-expanded.json";
import anythingOntologyExpanded from "../v2/ontologies/anything-ontology-expanded.json";
import minimalOntologyExpanded from "../v2/ontologies/minimal-ontology-expanded.json";
import incunabulaOntologyExpanded from "../v2/ontologies/incunabula-ontology-expanded.json";
import knoraApiOntologyExpanded from "../v2/ontologies/knora-api-ontology-expanded.json";

Expand Down Expand Up @@ -44,10 +43,6 @@ export namespace MockOntology {
ontologyJsonld = anythingOntologyExpanded;
break;
}
case "http://0.0.0.0:3333/ontology/0001/minimal/v2": {
ontologyJsonld = minimalOntologyExpanded;
break;
}
default: {
throw new Error("Ontology not supported: " + ontoIri);
}
Expand Down Expand Up @@ -151,7 +146,7 @@ export namespace MockOntology {
});

return new ResourceClassAndPropertyDefinitions(
{[resClassIri]: new ResourceClassDefinitionWithPropertyDefinition(tmpClasses[resClassIri], tmpProps)},
{ [resClassIri]: new ResourceClassDefinitionWithPropertyDefinition(tmpClasses[resClassIri], tmpProps) },
tmpProps
);

Expand Down

0 comments on commit 978a507

Please sign in to comment.