Skip to content

Cannot build a top level PossibleWorld  #194

Open
@Fabalab

Description

@Fabalab

Describe the bug
Every possible_world inherits from state and, therefore, must be part of a possible_world. To break the recursion, (ie. for a top-level possible_world) a self reference is needed. However, this is not possible using the builder classes supplied in hqdm-canonical. Should there be an extra, partOfOwnPossibleWorld() method on the PossibleWorldBuilder class that allows you to make this self-referential relationship?

To Reproduce
Steps to reproduce the behavior:
Run the following code:

final IRI topLevelWorldIri = new IRI(HQDM.HQDM, "Top_Level_World");
final PossibleWorldBuilder topLevelWorldBuilder = new PossibleWorldBuilder(topLevelWorldIri);
final PossibleWorld topLevelWorld = topLevelWorldBuilder.build();

It will return the following error:

Exception in thread "main" uk.gov.gchq.magmacore.hqdm.exception.HqdmException: Property Not Set: part_of_possible_world
	at uk.gov.gchq.magmacore.hqdm.rdfbuilders.PossibleWorldBuilder.build(PossibleWorldBuilder.java:268)
	at main.Program.main(Program.java:20)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions