Skip to main content

OBA: An Ontology-Based Framework for Creating REST APIs for Knowledge Graphs

  • Conference paper
  • First Online:
The Semantic Web – ISWC 2020 (ISWC 2020)

Part of the book series: Lecture Notes in Computer Science ((LNISA,volume 12507))

Included in the following conference series:

Abstract

In recent years, Semantic Web technologies have been increasingly adopted by researchers, industry and public institutions to describe and link data on the Web, create web annotations and consume large knowledge graphs like Wikidata and DBpedia. However, there is still a knowledge gap between ontology engineers, who design, populate and create knowledge graphs; and web developers, who need to understand, access and query these knowledge graphs but are not familiar with ontologies, RDF or SPARQL. In this paper we describe the Ontology-Based APIs framework (OBA), our approach to automatically create REST APIs from ontologies while following RESTful API best practices. Given an ontology (or ontology network) OBA uses standard technologies familiar to web developers (OpenAPI Specification, JSON) and combines them with W3C standards (OWL, JSON-LD frames and SPARQL) to create maintainable APIs with documentation, units tests, automated validation of resources and clients (in Python, Javascript, etc.) for non Semantic Web experts to access the contents of a target knowledge graph. We showcase OBA with three examples that illustrate the capabilities of the framework for different ontologies.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 89.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    https://lod-cloud.net/.

  2. 2.

    https://developers.google.com/knowledge-graph.

  3. 3.

    https://www.microsoft.com/en-us/research/project/microsoft-academic-graph/.

  4. 4.

    http://spec.openapis.org/oas/v3.0.3.

  5. 5.

    https://www.w3.org/2004/03/trix/.

  6. 6.

    https://github.com/OAI/OpenAPI-Specification.

  7. 7.

    http://spec.openapis.org/oas/v3.0.3.

  8. 8.

    https://github.com/OAI/OpenAPI-Specification/blob/master/IMPLEMENTATIONS.md.

  9. 9.

    Alternatively, may be used to allow developers to post their own ids.

  10. 10.

    We follow the best practices for RESTful API design: paths are in non-capital letters and always in plural (e.g., /regions, /persons, etc.).

  11. 11.

    https://oba.readthedocs.io/en/latest/mapping/.

  12. 12.

    https://yaml.org/.

  13. 13.

    https://editor.swagger.io/.

  14. 14.

    https://github.com/KnowledgeCaptureAndDiscovery/OBA_sparql/.

  15. 15.

    https://github.com/OpenAPITools/openapi-generator.

  16. 16.

    https://oba.readthedocs.io/en/latest/server/.

  17. 17.

    https://firebase.google.com/docs/auth/.

  18. 18.

    https://oauth.net/2/.

  19. 19.

    https://oba.readthedocs.io/en/latest/adding_custom_queries/.

  20. 20.

    https://pythonhosted.org/Flask-Testing/.

  21. 21.

    https://flask.palletsprojects.com/en/1.1.x/.

  22. 22.

    https://oba.readthedocs.io/en/latest/test/.

  23. 23.

    https://model-catalog-python-api-client.readthedocs.io/en/latest/.

  24. 24.

    https://oba.readthedocs.io/en/latest/examples/.

  25. 25.

    https://wiki.dbpedia.org/services-resources/ontology.

  26. 26.

    https://github.com/sirspock/dbpedia_api_client.

  27. 27.

    https://github.com/sirspock/dbpedia_example/.

  28. 28.

    https://model-catalog-python-api-client.readthedocs.io/en/latest/endpoints/.

  29. 29.

    https://models.mint.isi.edu.

  30. 30.

    https://lists.w3.org/Archives/Public/semantic-web/2015Jan/0087.html.

  31. 31.

    https://lists.w3.org/Archives/Public/semantic-web/2018Nov/0036.html.

  32. 32.

    https://github.com/dbooth-boston/EasierRDF.

  33. 33.

    https://oba.readthedocs.io/en/latest/quickstart/.

  34. 34.

    http://marmotta.apache.org/.

  35. 35.

    https://www.trellisldp.org/about.html.

  36. 36.

    https://atomgraph.github.io/Linked-Data-Templates/.

  37. 37.

    https://github.com/oeg-upm/r4r.

  38. 38.

    https://github.com/opencitations/ramose.

  39. 39.

    https://github.com/usc-isi-i2/sparql-jsonld.

  40. 40.

    https://graphql.org/.

  41. 41.

    https://www.stardog.com/categories/graphql/.

  42. 42.

    https://github.com/hammar/owl2oas.

References

  1. Auer, S., Bizer, C., Kobilarov, G., Lehmann, J., Cyganiak, R., Ives, Z.: DBpedia: a nucleus for a web of open data. In: Aberer, K., et al. (eds.) ASWC/ISWC -2007. LNCS, vol. 4825, pp. 722–735. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-76298-0_52

    Chapter  Google Scholar 

  2. Cyganiak, R., Lanthaler, M., Wood, D.: RDF 1.1 concepts and abstract syntax. W3C recommendation, W3C (2014) http://www.w3.org/TR/2014/REC-rdf11-concepts-20140225/

  3. Daga, E., Panziera, L., Pedrinaci, C.: A BASILar approach for building Web APIs on top of SPARQL endpoints. In: Proceedings of the Third Workshop on Services and Applications over Linked APIs and Data, co-located with the 12th Extended Semantic Web Conference (ESWC 2015), 1359, 22–32 (2015)

    Google Scholar 

  4. Dirsumilli, R., Mossakowski, T.: RESTful encapsulation of OWL API. In: Proceedings of the 5th International Conference on Data Management Technologies and Applications, DATA 2016, SCITEPRESS - Science and Technology Publications, Lda, Setubal, PRT, pp. 150–157 (2016)

    Google Scholar 

  5. Garijo, D., Osorio, M., Khider, D., Ratnakar, V., Gil, Y.: OKG-Soft: an Open Knowledge Graph with Machine Readable Scientific Software Metadata. In: 2019 15th International Conference on eScience (eScience), San Diego, CA, USA, pp. 349–358. IEEE (2019) https://doi.org/10.1109/eScience.2019.00046

  6. Kellogg, G., Champin, P.A., Longley, D.: JSON-LD 1.1. Candidate recommendation, W3C (2020) https://www.w3.org/TR/2020/CR-json-ld11-20200417/

  7. Lisena, P., Meroño-Peñuela, A., Kuhn, T., Troncy, R.: Easy web API development with SPARQL transformer. In: Ghidini, C., et al. (eds.) ISWC 2019. LNCS, vol. 11779, pp. 454–470. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-30796-7_28

    Chapter  Google Scholar 

  8. Malhotra, A., Arwe, J., Speicher, S.: Linked data platform 1.0. W3C recommendation, W3C (2015) http://www.w3.org/TR/2015/REC-ldp-20150226/

  9. Mihindukulasooriya, N., Poveda-Villalón, M., García-Castro, R., Gómez-Pérez, A.: Loupe - an online tool for inspecting datasets in the linked data cloud. In: Proceedings of the ISWC 2015 Posters & Demonstrations Track co-located with the 14th International Semantic Web Conference (ISWC-2015), Bethlehem, PA, USA. CEUR Workshop Proceedings, CEUR-WS.org, 1486 (2015)

    Google Scholar 

  10. Patel-Schneider, P., Motik, B., Parsia, B.: OWL 2 web ontology language structural specification and functional-style syntax (2 edn). W3C recommendation, W3C (2012) http://www.w3.org/TR/2012/REC-owl2-syntax-20121211/

  11. Meroño-Peñuela, A., Hoekstra, R.: GRLC makes gitHub taste like linked data APIs. In: Sack, H., Rizzo, G., Steinmetz, N., Mladenić, D., Auer, S., Lange, C. (eds.) ESWC 2016. LNCS, vol. 9989, pp. 342–353. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-47602-5_48

    Chapter  Google Scholar 

  12. Seaborne, A., Harris, S.: SPARQL 1.1 query language. W3C recommendation, W3C (2013) http://www.w3.org/TR/2013/REC-sparql11-query-20130321/

  13. Soiland-Reyes, S.: Owl2Jsonld 0.2.1 (2014) https://doi.org/10.5281/ZENODO.10565

  14. Taelman, R., Vander Sande, M., Verborgh, R.: GraphQL-LD: linked data querying with GraphQL. In: Proceedings of the 17th International Semantic Web Conference: Posters and Demos, pp. 1–4 (2018)

    Google Scholar 

  15. Vrandečić, D., Krötzsch, M.: Wikidata: a free collaborative knowledgebase. Commun. ACM 57(10), 78–85 (2014)

    Article  Google Scholar 

  16. Zhu, Q., et al.: Collective multi-type entity alignment between knowledge graphs. In: Proceedings of The Web Conference 2020, WWW ’20, Association for Computing Machinery, New York, NY, USA, pp. 2241–2252 (2020)

    Google Scholar 

Download references

Acknowledgements

This work was funded by the Defense Advanced Research Projects Agency with award W911NF-18-1-0027 and the National Science Foundation with award ICER-1440323. The authors would like to thank Yolanda Gil, Paola Espinoza, Carlos Badenes, Oscar Corcho, Karl Hammar and the ISWC anonymous reviewers for their thoughtful comments and feedback.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Daniel Garijo .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Garijo, D., Osorio, M. (2020). OBA: An Ontology-Based Framework for Creating REST APIs for Knowledge Graphs. In: Pan, J.Z., et al. The Semantic Web – ISWC 2020. ISWC 2020. Lecture Notes in Computer Science(), vol 12507. Springer, Cham. https://doi.org/10.1007/978-3-030-62466-8_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-62466-8_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-62465-1

  • Online ISBN: 978-3-030-62466-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics