Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to convert CGMES triples into a powsybl Network #3292

Open
bishoyroufael opened this issue Jan 28, 2025 · 0 comments
Open

How to convert CGMES triples into a powsybl Network #3292

bishoyroufael opened this issue Jan 28, 2025 · 0 comments

Comments

@bishoyroufael
Copy link

bishoyroufael commented Jan 28, 2025

Hi!

After a lot of researching, I couldn't find a way to go from a triple store to a powsybl Network. I don't want to read a file directly from powsybl. The workflow will be that triple store will be queried from an Apache Jena server and then fed into powsybl for load flow calculations.

Here's what I got:

  public static void main(String[] args) {
        // Step 1: Create a Jena Dataset and load RDF data
        // Model model = ModelFactory.createDefaultModel();
        
        TripleStoreJena tripleStore = new TripleStoreJena();
        // Load RDF data from a file or resource
        try (InputStream inputStream = Main.class.getResourceAsStream("/SmallGridTestConfiguration_BC_EQ_v3.0.0.xml")) {
            if (inputStream == null) {
                throw new IllegalArgumentException("RDF data file not found!");
            }
            tripleStore.read(inputStream, "","eq.xml");
            // RDFDataMgr.read(model, inputStream, Lang.TURTLE);
        } catch (Exception e) {
            e.printStackTrace();
        }
        
        // How to generate a network from the triple store?
        // Network cgmesNetwork = Network.read()

        System.out.println("Done!");
    }

I am on version 6.6.1. Can you please guide me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant