Skip to content

Commit

Permalink
fix: generate simple examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mosoriob committed Jun 30, 2020
1 parent 4ba052a commit 3211290
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
6 changes: 3 additions & 3 deletions examples/dbpedia/config_music.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ endpoint:

## Filter the paths by methods
enable_get_paths: true
enable_post_paths: false
enable_delete_paths: false
enable_put_paths: false
enable_post_paths: true
enable_delete_paths: true
enable_put_paths: true

## Select the classes to add in the API
classes:
Expand Down
7 changes: 3 additions & 4 deletions examples/modelcatalog/config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
ontologies:
- https://mintproject.github.io/Mint-ModelCatalog-Ontology/release/1.4.0/ontology.xml
- https://knowledgecaptureanddiscovery.github.io/SoftwareDescriptionOntology/release/1.5.0/ontology.xml
- https://w3id.org/okn/o/sdm/1.5.0
- https://w3id.org/okn/o/sd/1.6.0
name: modelcatalog
output_dir: outputs

openapi:
openapi: 3.0.1
info:
Expand All @@ -22,7 +21,7 @@ firebase:
key: "test"

endpoint:
url: http://endpoint.mint.isi.edu/modelCatalog-1.4.0
url: https://endpoint.mint.isi.edu/modelCatalog-1.4.0
prefix: https://w3id.org/okn/i/mint
graph_base: http://endpoint.mint.isi.edu/modelCatalog-1.4.0/data/

Expand Down
7 changes: 7 additions & 0 deletions src/main/java/edu/isi/oba/MapperSchema.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package edu.isi.oba;


import io.swagger.v3.oas.models.examples.Example;
import io.swagger.v3.oas.models.media.Schema;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.*;
Expand Down Expand Up @@ -73,6 +75,11 @@ private Schema setSchema() {
schema.setDescription(this.cls_description);
schema.setType(this.type);
schema.setProperties(this.getProperties());
HashMap<String, String> exampleMap = new HashMap<>();
exampleMap.put("id", "some_id");
Example example = new Example();
example.setValue(exampleMap);
schema.setExample(example);
return schema;
}

Expand Down
Binary file modified src/main/resources/servers.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pythonql3==0.9.61
connexion >= 2.6.0
obasparql >= 3.3.1
obasparql >= 3.3.3
werkzeug==0.16.1
swagger-ui-bundle >= 0.0.2
python_dateutil >= 2.6.0
Expand Down

0 comments on commit 3211290

Please sign in to comment.