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

Repeated structures do not have defect-related triples #158

Closed
GuojingHuangAa opened this issue Aug 8, 2024 · 3 comments · Fixed by #159
Closed

Repeated structures do not have defect-related triples #158

GuojingHuangAa opened this issue Aug 8, 2024 · 3 comments · Fixed by #159

Comments

@GuojingHuangAa
Copy link

Hello Sarath, thanks for you efforts to the issue #156 . I have reinstalled my atomRDF. However, I could not see the changes in structure.py (also in the repo) file and the repeated structures still can not be annotated. Could you please give me a few instructions of that. Thank you so much.

@srmnitc
Copy link
Member

srmnitc commented Aug 8, 2024

Thanks @GuojingHuangAa for raising this issue.

The code changes are made here

Could you please confirm whether you tested for bulk structures or grain boundaries. For bulk structures, repeated structures are annotated, either using:

from atomrdf import KnowledgeGraph, System
kg = KnowledgeGraph()
struct_Fe = System.create.element.Fe(graph=kg, repetitions=(3,4,4))

or calling struct_Fe.modify.repeat.

For GB structures, adding repetitions when creating the structure does not work at the moment. #155 would have to be solved first. However, the modify.repeat still works (add the correct triples, but creates multiple GBs which is maybe something you do not want).

If it does not work for you, please give a small example and I will take a look. Thanks again!

@GuojingHuangAa
Copy link
Author

GuojingHuangAa commented Aug 9, 2024

Hi Sarath, thanks so much for your reply. I thought the function didn't work because the repeated GB is not shown in kg.query_sample:
I created gb like this:

gb = System.create.defect.grain_boundary(axis=[1,-1,0], sigma=3, gb_plane=[1,1,-2],
                                         element = 'Fe',
                                         structure = 'bcc',
                                         lattice_constant = 2.83441,
                                         uc_a=2, uc_b=2,
                                         overlap = 0.0,
                                         graph = kg)

and one sample is shown on the datafram with kg.query_sample:

res = kg.query_sample([kg.ontology.terms.pldo.SymmetricalTiltGrainBoundary, 
                     kg.ontology.terms.pldo.hasSigmaValue])
res

and I repeated the structure and queried again

gb2 = gb.modify.repeat(repetitions=(1,1,2))
res = kg.query_sample([kg.ontology.terms.pldo.SymmetricalTiltGrainBoundary, 
                     kg.ontology.terms.pldo.hasSigmaValue])
res

and there is still one sample shown on the dataframe
But now I found that when I run kg.visualise(workflow_view=False, layout='dot', hide_types=False), two samples are visualized, so I think the repeated function is working well?

@srmnitc
Copy link
Member

srmnitc commented Aug 9, 2024

@GuojingHuangAa Thanks for the clarification. The repeat function is workin, but you have spotted another issue which also needs to be fixed. What is happening is that when the repeat function is called, it does create a new structure and annotate it as expected; but the GB related triples are not copied. Thanks for reporting this, I will fix it.

@srmnitc srmnitc changed the title Repeated structures can not be annotated to the graph Repeated structures do not have defect-related triples Aug 9, 2024
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

Successfully merging a pull request may close this issue.

2 participants