9.2.2 Semantic Query Utilities

When sending a SPARQL query as a request parameter for a oneM2M primitive, the query must be "url" encoded. There are many libraries that do this operation and for this example python was used.

import urllib.parse

def encodedSparqlQuery(query):
    return urllib.parse.quote(query, safe='')