Skip to main content

Enabling Live SPARQL Queries over ConceptNet Using Triple Pattern Fragments

  • Conference paper
  • First Online:
The Semantic Web (ESWC 2023)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 13870))

Included in the following conference series:

Abstract

We describe how we used a Triple Pattern Fragments (TPF) interface and the Comunica knowledge graph querying framework to enable live SPARQL queries over ConceptNet, one of largest knowledge graphs for commonsense reasoning publicly available on the Web. Despite being a Linked Data resource, the official ConceptNet is not published in RDF and does not support SPARQL. Instead, it provides a RESTful API for live queries, which are restricted to simple triple patterns. This limited API makes it hard for users to search for non-trivial patterns in the graph and hinders the possibility of federated queries offered by SPARQL. There have been attempts to convert ConceptNet to RDF but such proposals tend to quickly become obsolete. In this paper, we take a different route. We use TPF to expose a low-level RDF query interface to ConceptNet. This low-level interface is built on top of the ConceptNet API and can be used by TPF-compatible SPARQL engines such as Comunica. Using this approach, we were able evaluate non-trivial SPARQL queries, including federated queries, over ConceptNet on-the-fly. Our experiments showed that overhead incurred is small and can be further reduced by optimizing ConceptNet’s internal edge representation. We argue that such overhead is justified by the gains in expressivity and flexibility. Moreover, the overall approach is general and can be extended to other non-RDF knowledge graphs.

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
Softcover Book
USD 119.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    https://www.postgresql.org/.

  2. 2.

    https://github.com/commonsense/conceptnet5/wiki/FAQ.

  3. 3.

    https://github.com/LinkedDataFragments/Server.js.

  4. 4.

    https://github.com/IBM/tpf-conceptnet-datasource.

  5. 5.

    https://en.wiktionary.org/.

  6. 6.

    https://linkeddatafragments.org/data/.

  7. 7.

    https://github.com/comunica/comunica.

  8. 8.

    https://comunica.dev/docs/query/advanced/specifications/.

  9. 9.

    https://github.com/LinkedDataFragments/Server.js.

  10. 10.

    https://github.com/IBM/tpf-conceptnet-datasource.

  11. 11.

    https://github.com/IBM/tpf-conceptnet-datasource/tree/main/simplified-conceptnet5.

  12. 12.

    https://www.postgresql.org/docs/current/datatype-json.html.

  13. 13.

    https://github.com/commonsense/ConceptNet5 (fda1b39, Sep. 7, 2021.).

  14. 14.

    https://github.com/LinkedDataFragments/Server.js (b8cc6e3, Nov. 11, 2022.).

  15. 15.

    https://github.com/comunica/comunica (e4b91d5, Nov. 25, 2022.).

References

  1. Cai, H., Zhao, F., Jin, H.: Commonsense knowledge construction with concept and pretrained model. In: Zhao, X., Yang, S., Wang, X., Li, J. (eds.) WISA 2022. LNCS, vol. 13579, pp. 40–51. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-20309-1_4

    Chapter  Google Scholar 

  2. Chen, H., Trouve, A., Murakami, K.J., Fukuda, A.: An introduction to question answering with ConceptRDF. In: Proceedings of 2nd IEEE International Conference on Computational Intelligence and Applications (ICCIA), Beijing, China, 8–11 September 2017, pp. 537–541. IEEE (2017). https://doi.org/10.1109/CIAPP.2017.8167275

  3. Chen, H., Trouve, A., Murakami, K.J., Fukuda, A.: A concise conversion model for improving the RDF expression of ConceptNet knowledge base. In: Lu, H., Xu, X. (eds.) Artificial Intelligence and Robotics. SCI, vol. 752, pp. 213–221. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-69877-9_23

    Chapter  Google Scholar 

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

  5. Fernández, J.D., Martínez-Prieto, M.A., Gutiérrez, C., Polleres, A., Arias, M.: Binary RDF representation for publication and exchange (HDT). J. Web Semant. 19, 22–41 (2013). https://doi.org/10.1016/j.websem.2013.01.002

    Article  Google Scholar 

  6. Fielding, R.T.: Architectural styles and the design of network-based software architectures. Ph.D. thesis, University of California, Irvine (2000)

    Google Scholar 

  7. Grassi, M., Piazza, F.: Towards an RDF encoding of ConceptNet. In: Liu, D., Zhang, H., Polycarpou, M., Alippi, C., He, H. (eds.) ISNN 2011. LNCS, vol. 6677, pp. 558–565. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-21111-9_63

    Chapter  Google Scholar 

  8. Lehmann, J., et al.: DBpedia - a large-scale, multilingual knowledge base extracted from Wikipedia. Semant. Web 6, 167–195 (2015). https://doi.org/10.3233/SW-140134

    Article  Google Scholar 

  9. Lin, B.Y., Wu, Z., Yang, Y., Lee, D.H., Ren, X.: RiddleSense: reasoning about riddle questions featuring linguistic creativity and commonsense knowledge. In: Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pp. 1504–1515. ACL (2021). https://doi.org/10.18653/v1/2021.findings-acl.131

  10. Longley, D., Kellogg, G., Lanthaler, M., Sporny, M., Lindström, N.: JSON-LD 1.1 processing algorithms and API. W3C recommendation, W3C (2020). https://www.w3.org/TR/json-ld11-api/

  11. Miller, G.A.: WordNet: a lexical database for english. Commun. ACM 38(11), 39–41 (1995). https://doi.org/10.1145/219717.219748

    Article  Google Scholar 

  12. Najmi, E., Hashmi, K., Malik, Z., Rezgui, A., Khanz, H.U.: ConceptOnto: an upper ontology based on ConceptNet. In: Proceedings of the IEEE/ACS 11th International Conference on Computer Systems and Applications (AICCSA), pp. 366–372. IEEE (2014). https://doi.org/10.1109/AICCSA.2014.7073222

  13. Najmi, E., Malik, Z., Hashmi, K., Rezgui, A.: ConceptRDF: an RDF presentation of ConceptNet knowledge base. In: Proceedings of 7th International Conference on Information and Communication Systems (ICICS), pp. 145–150. IEEE (2016)

    Google Scholar 

  14. Pérez, J., Arenas, M., Gutierrez, C.: Semantics and complexity of SPARQL. ACM Trans. Database Syst. 34(3), 16:1–16:45 (2009). https://doi.org/10.1145/1567274.1567278

  15. Prud’hommeaux, E., Buil-Aranda, C.: SPARQL 1.1 federated query. W3C recommendation, W3C (2013). https://www.w3.org/TR/2013/REC-sparql11-federated-query-20130321/

  16. Singh, P.: The public acquisition of commonsense knowledge. In: Proceedings of the AAAI Spring Symposium: Acquiring (and Using) Linguistic (and World) Knowledge for Information Access. AAAI (2002)

    Google Scholar 

  17. Speer, R., Chin, J., Havasi, C.: ConceptNet 5.5: an open multilingual graph of general knowledge. In: Proceedings of the 31st AAAI Conference on Artificial Intelligence (AAAI-17), San Francisco, California, USA, 4–9 February 2017, pp. 4444–4451. AAAI (2017)

    Google Scholar 

  18. Speer, R., Lowry-Duda, J.: ConceptNet at SemEval-2017 task 2: extending word embeddings with multilingual relational knowledge. In: Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), Vancouver, Canada, August 2017, pp. 85–89. ACL (2017). https://doi.org/10.18653/v1/S17-2008

  19. Sporny, M., Longley, D., Kellogg, G., Lanthaler, M., Champin, P.A., Lindström, N.: JSON-LD 1.1: a JSON-based serialization for linked data. W3C recommendation, W3C (2020). https://www.w3.org/TR/json-ld/

  20. Taelman, R., Van Herwegen, J., Vander Sande, M., Verborgh, R.: Comunica: a modular SPARQL query engine for the web. In: Vrandečić, D., et al. (eds.) ISWC 2018. LNCS, vol. 11137, pp. 239–255. Springer, Cham (2018). https://doi.org/10.1007/978-3-030-00668-6_15

    Chapter  Google Scholar 

  21. Tamilselvam, S., Nagar, S., Mishra, A., Dey, K.: Graph based sentiment aggregation using ConceptNet ontology. In: Proceedings of the 8th International Joint Conference on Natural Language Processing, Taipei, Taiwan, November 2017 (Volume 1: Long Papers), pp. 525–535. Asian Federation of Natural Language Processing (2017)

    Google Scholar 

  22. Vardi, M.Y.: The complexity of relational query languages (extended abstract). In: Proceedings of the 14th Annual ACM Symposium on Theory of Computing (STOC 1982), San Francisco, California, USA, May 1982, pp. 137–146. ACM (1982). https://doi.org/10.1145/800070.802186

  23. Verborgh, R., Sande, M.V., Colpaert, P., Coppens, S., Mannens, E., de Walle, R.V.: Web-scale querying through linked data fragments. In: Proceedings of the Workshop on Linked Data on the Web co-located with the 23rd International World Wide Web Conference (WWW 2014), Seoul, Korea, 8 April 2014. CEUR-WS.org (2014)

    Google Scholar 

  24. Verborgh, R., et al.: Triple pattern fragments: a low-cost knowledge graph interface for the web. J. Web Semantics 37–38, 184–206 (2016). https://doi.org/10.1016/j.websem.2016.03.003

    Article  Google Scholar 

  25. Vrandečić, D., Krötzsch, M.: WikiData: a free collaborative knowledgebase. Commun. ACM 57(10), 78–85 (2014). https://doi.org/10.1145/2629489

    Article  Google Scholar 

  26. W3C SPARQL working group: SPARQL 1.1 overview. W3C recommendation, W3C (2013). http://www.w3.org/TR/2013/REC-sparql11-overview-20130321/

  27. Ye, S., Xie, Y., Chen, D., Xu, Y., Yuan, L., Zhu, C., Liao, J.: Improving commonsense in vision-language models via knowledge graph riddles (2022). https://doi.org/10.48550/ARXIV.2211.16504

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Marcelo Machado .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Machado, M., Lima, G., Soares, E., Uceda-Sosa, R., Cerqueira, R. (2023). Enabling Live SPARQL Queries over ConceptNet Using Triple Pattern Fragments. In: Pesquita, C., et al. The Semantic Web. ESWC 2023. Lecture Notes in Computer Science, vol 13870. Springer, Cham. https://doi.org/10.1007/978-3-031-33455-9_39

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-33455-9_39

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-33454-2

  • Online ISBN: 978-3-031-33455-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics