-
Notifications
You must be signed in to change notification settings - Fork 135
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
Assorted bug fixes #263
Assorted bug fixes #263
Changes from all commits
cdd061c
fd0c33f
5772b0a
9b97118
54c0ec8
83862f9
89e1abb
6b3a929
ba8f68c
3ff5260
8334dcb
57a4672
146bb65
293c811
93fe64d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1018,10 +1018,11 @@ def write(self, doc_node=None): | |
for package_node in self.packages(): | ||
package_triple = (doc_node, self.spdx_namespace.describesPackage, package_node) | ||
self.graph.add(package_triple) | ||
"""# Add relationship | ||
relate_node = self.relationships() | ||
relate_triple = (doc_node, self.spdx_namespace.relationship, relate_node) | ||
self.graph.add(relate_triple)""" | ||
# Add relationship | ||
for relate_node in self.relationships(): | ||
relate_triple = (doc_node, self.spdx_namespace.relationship, relate_node) | ||
self.graph.add(relate_triple) | ||
|
||
Comment on lines
+1021
to
+1025
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did the same as in your comment here and still got the same result. I think this should be fixed before merging this PR. |
||
# Add snippet | ||
snippet_nodes = self.snippets() | ||
for snippet in snippet_nodes: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,3 +76,4 @@ | |
} | ||
] | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,4 +56,4 @@ | |
] | ||
} | ||
] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,4 +56,4 @@ | |
] | ||
} | ||
] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,8 +61,11 @@ | |
}, | ||
"ns1:fileName": "./some/path/tofile" | ||
} | ||
}, | ||
}, | ||
"ns1:relationship": {"ns1:Relationship": {"@rdf:about": "SPDXRef-DOCUMENT", | ||
"ns1:relatedSpdxElement": "SPDXRef-Package", | ||
"ns1:relationshipType": "DESCRIBES"}}, | ||
Comment on lines
+65
to
+67
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A comment about these additions: The structure in e.g. this example is different: The related element is usually expanded (making the whole thing completely unreadable), and there doesn't seem to be a reference to the current element (maybe relationships are put on the originating object instead of the top-level document?). Considering that there are other oddities in this test file as well (e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I know, elements in rdf files are normally expanded at the first place they appear (which does get quite muddy, yeah). |
||
"@rdf:about": "http://www.spdx.org/tools#SPDXRef-DOCUMENT" | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,37 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<Document> | ||
<spdxVersion>SPDX-2.1</spdxVersion> | ||
<dataLicense>CC0-1.0</dataLicense> | ||
<name>Sample_Document-V2.1</name> | ||
<SPDXID>SPDXRef-DOCUMENT</SPDXID> | ||
<documentNamespace>https://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301</documentNamespace> | ||
<documentDescribes>SPDXRef-Package</documentDescribes> | ||
<packages> | ||
<SPDXID>SPDXRef-Package</SPDXID> | ||
<name>some/path</name> | ||
<downloadLocation>NOASSERTION</downloadLocation> | ||
<copyrightText>Some copyrught</copyrightText> | ||
<packageVerificationCode> | ||
<packageVerificationCodeValue>SOME code</packageVerificationCodeValue> | ||
</packageVerificationCode> | ||
<checksums> | ||
<checksumValue>SOME-SHA1</checksumValue> | ||
<algorithm>SHA1</algorithm> | ||
</checksums> | ||
<licenseDeclared>NOASSERTION</licenseDeclared> | ||
<licenseConcluded>NOASSERTION</licenseConcluded> | ||
<licenseInfoFromFiles>LGPL-2.1-or-later</licenseInfoFromFiles> | ||
|
||
<hasFiles>SPDXRef-File</hasFiles> | ||
</packages> | ||
<files> | ||
|
||
<fileName>./some/path/tofile</fileName> | ||
<SPDXID>SPDXRef-File</SPDXID> | ||
<checksums> | ||
<checksumValue>SOME-SHA1</checksumValue> | ||
<algorithm>SHA1</algorithm> | ||
</checksums> | ||
<licenseConcluded>NOASSERTION</licenseConcluded> | ||
<copyrightText>NOASSERTION</copyrightText> | ||
<licenseInfoInFiles>LGPL-2.1-or-later</licenseInfoInFiles> | ||
|
||
</files> | ||
|
||
|
||
</Document> | ||
<Document> | ||
<spdxVersion>SPDX-2.1</spdxVersion> | ||
<dataLicense>CC0-1.0</dataLicense> | ||
<name>Sample_Document-V2.1</name> | ||
<SPDXID>SPDXRef-DOCUMENT</SPDXID> | ||
<documentNamespace>https://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301</documentNamespace> | ||
<documentDescribes>SPDXRef-Package</documentDescribes> | ||
<packages> | ||
<SPDXID>SPDXRef-Package</SPDXID> | ||
<name>some/path</name> | ||
<downloadLocation>NOASSERTION</downloadLocation> | ||
<copyrightText>Some copyrught</copyrightText> | ||
<packageVerificationCode> | ||
<packageVerificationCodeValue>SOME code</packageVerificationCodeValue> | ||
</packageVerificationCode> | ||
<checksums> | ||
<checksumValue>SOME-SHA1</checksumValue> | ||
<algorithm>SHA1</algorithm> | ||
</checksums> | ||
<licenseDeclared>NOASSERTION</licenseDeclared> | ||
<licenseConcluded>NOASSERTION</licenseConcluded> | ||
<licenseInfoFromFiles>LGPL-2.1-or-later</licenseInfoFromFiles> | ||
<hasFiles>SPDXRef-File</hasFiles> | ||
</packages> | ||
<files> | ||
<fileName>./some/path/tofile</fileName> | ||
<SPDXID>SPDXRef-File</SPDXID> | ||
<checksums> | ||
<checksumValue>SOME-SHA1</checksumValue> | ||
<algorithm>SHA1</algorithm> | ||
</checksums> | ||
<licenseConcluded>NOASSERTION</licenseConcluded> | ||
<copyrightText>NOASSERTION</copyrightText> | ||
<licenseInfoInFiles>LGPL-2.1-or-later</licenseInfoInFiles> | ||
</files> | ||
</Document> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we use these two functions if the
validate
method only calls thevalidate_relationship
method? IMHO we should only use thevalidate_relationship
method.