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

Circular references #20

Open
Juul opened this issue Oct 14, 2011 · 4 comments
Open

Circular references #20

Juul opened this issue Oct 14, 2011 · 4 comments

Comments

@Juul
Copy link

Juul commented Oct 14, 2011

It is possible to create, serialize and deserialize a Collection that includes DnaComponents that have SequenceAnnotations whose subComponents refer back to the original DnaComponent.

The serializer doesn't complain or fail.

The problem is that circular references do not make sense for DNA. This could cause problems. E.g. you can imagine a web service crashing when someone gives it an SBOL file that has been crafted to contain circular references. Even though the deserializer wouldn't fail, the code interpreting the resulting data structure may not realize that it has to watch out for circular references and loop/recurse forever.

I'm adding this issue to libSBOLcore as well, since it should be a restriction in the data model which the XML serializer enforces.

@drdozer
Copy link
Member

drdozer commented Oct 14, 2011

I think this can be fixed in practice by adding a consistency restriction: The length of a SequenceAnnotation must be strictly less than the length of the parent DC. There should already be the consistency restriction that the bioStart and bioEnd must be positions within the parent (e.g. sa.bioStart >=1 and sa.bioEnd <= sa.parent.length). If not, it needs adding.

How does that sound?

@Juul
Copy link
Author

Juul commented Oct 14, 2011

How does that sound?

The problem with that solution is that bioStart and bioEnd are optional.

@drdozer
Copy link
Member

drdozer commented Oct 14, 2011

OK... so if we have:

dc1 -> sa -> dc2

Then: dc1.length > dc2.length. Although perhaps length is also optional for virtual DCs.

Short of a full, recursive check for cycles, I don't see what else can be done for the sub-graph of virtual DCs. In any case, we need to state that cycles are not allowed.

@Juul
Copy link
Author

Juul commented Oct 17, 2011

Yeah they're also optional. I think we should do the check, but have an option to disable the check.

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

2 participants