Forum Discussion

AyusmanBasu0604's avatar
3 months ago

Ontology Relationships & Binding using REST APIs

We are trying to Get Ontology created and also it's realtionships defined using REST APIs.

We tried using notebooks, even though the Ontology is getting created, showing binding but it's actually unable to create the relationship. Some issue with the Contextualization. We had referred the following: trucking-ontology/notebooks/03_create_ontology.ipynb at main · robkerr/trucking-ontology · GitHub 


1. Referred the official docs: https://learn.microsoft.com/en-us/rest/api/fabric/ontology/items

When we tried using Python SDK, we keep getting error that "service is not reachable"

 

Also, referred the following POST: https://community.fabric.microsoft.com/t5/Service/How-to-interact-programatically-with-Ontology/m-p/5115243 and also Microsoft's release: https://roadmap.fabric.microsoft.com/?product=iq Figured, SDKs are unavailable so we went for notebook based approach. so is it like binding is still not supported using REST APIs?


Any comment would be helpful!
We just want to know if the binding is doable using REST APIs

3 Replies

  • Hello AyusmanBasu0604 ,

    welcome to this fabric community forum.

    The Fabric Ontology comes with an API for the ontology definition, but the message format is not described well.

    I tried it myself and was able to back up and restore the Ontology as seen in this blog post.

    As seen there, it should be possible to export and import entity types, relationships, and bindings.

    At this moment, you need to research the format seen there to understand how it works..

    --

    If this answer helps you, a thumbs-up or marking it as the accepted answer is appreciated. All community members with similar questions will benefit by doing so. Your contribution is highly appreciated.

  • Thanks for sharing the details , based on what you described, you’re on the right track and this is actually a limitation of the current Fabric IQ APIs. While the REST APIs allow you to define ontology entities, relationships, and bindings in the payload, the full lifecycle (especially relationship creation and contextualization) is not yet reliably executed when done programmatically, which is why you see bindings reflected but not functioning as expected; the same applies to the “service is not reachable” error with the SDK, as those endpoints are still evolving. In short, relationships and bindings are supported at the definition level, but end-to-end activation via REST APIs is still not fully stable, so the most reliable approach today is to create and validate the ontology (including relationships) via the UI and then use REST APIs primarily for export/import or propagation scenarios.

     

  • hey AyusmanBasu0604 from what I check, binding relationships via REST does not seem fully supported/stable yet.
    Fabric Ontology is still in preview, and while REST APIs exist to create the ontology definition, the format for relationships and contextualization is not well documented.
    Relationships require separate “contextualization” objects that link to a dataset, and this is where most implementations fail.

    In practice, you can create ontology + entity types via REST, partially define relationships but end-to-end relationship binding via REST is not reliably supported today. Even Microsoft samples rely on notebooks with prebuilt JSON, and the Python SDK is not fully available (hence the “service not reachable” issues).

     

    Appreciate if you can "Kudos" and/or "Accept as Solution" if this answered your query.