Search Docs…

Search Docs…

Orpheus API Reference

Advanced Graph Wikidata Schema


POST Advanced Graph Wikidata Schema


https://api.wisecube.ai/orpheus/graphql

This API allows querying the knowledge graph using SPARQL. Refer to the examples on how to query the graph.

BODY graphql

QUERY

query fetchAdvancedSearch($advancedSearchQuery: String!){
    advancedSearch(query: $advancedSearchQuery){
        description
        columns
        rows{
            values
        }
    }
}

GRAPHQL VARIABLES

{ "sparql":"refer_to_examples_for_URL_encoded_SPARQL_queries" }

Example Request: Drugs by same active ingredient

POST /orpheus/graphql HTTP/1.1 
Host: api.wisecube.ai 
Content-Type: application/json 
Content-Length: 1324 

{"query":"query fetchAdvancedSearch($advancedSearchQuery: String!){\n    advancedSearch(query: $advancedSearchQuery){\n        description\n        columns\n        rows{\n            values\n        }\n    }\n}","variables":{"advancedSearchQuery":"%0A%20PREFIX%20rdfs:%20%3Chttp://www.w3.org/2000/01/rdf-schema#%3E%20%0A%20SELECT%20DISTINCT%20?this%20?this_label%20WHERE%20%7B%0A%20%20?this%20%3Chttp://www.wikidata.org/prop/direct/P31%3E%20%3Chttp://www.wikidata.org/entity/Q28885102%3E.%0A%20%20?this%20%3Chttp://www.wikidata.org/prop/direct/P176%3E%20%3Chttp://www.wikidata.org/entity/Q206921%3E.%0A%20%20?this%20%3Chttp://www.w3.org/2000/01/rdf-schema#label%3E%20?this_label.%0A%20%20FILTER(LANGMATCHES(LANG(?this_label),%20%22en%22))%0A%7D%0ALIMIT%2010"}}

Example Response

{
    "data": {
        "advancedSearch": {
            "description": "Dataframe results",
            "columns": [
                "this",
                "this_label"
            ],
            "rows": [
                {
                    "values": [
                        "http://www.wikidata.org/entity/Q5375179",
                        "enalaprilat"
                    ]
                },
                {...},
                {...}
                
            ]
        }
    }
}


Wisecube AI

© 2024