Created
May 30, 2022 13:34
-
-
Save ioggstream/31f3226fa9976b3baf0800f44bc19c98 to your computer and use it in GitHub Desktop.
Show anchor usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rdflib import Graph | |
import yaml | |
d = yaml.safe_load(Path("d3fend.yaml").read_text()) | |
g=Graph() | |
g.parse(data=json.dumps(d), format="application/ld+json") | |
print(g.serialize(format="application/ld+json")) | |
--- | |
"@context": | |
"@vocab": &d3fend "http://d3fend.mitre.org/ontologies/d3fend.owl#" | |
"@base": *d3fend | |
owl: "http://www.w3.org/2002/07/owl#" | |
rdfs: "http://www.w3.org/2000/01/rdf-schema#" | |
"@graph": | |
- '@id': ApplicationHardening | |
'@type': &defensiveTechniqueClassess # Anchor this list | |
- DefensiveTechnique | |
- owl:Class | |
- owl:NamedIndividual | |
d3fend-id: | |
- '@value': D3-AH | |
definition: | |
- '@value': |- | |
Application Hardening makes an executable application more resilient | |
to a class of exploits which either introduce new code or execute unwanted existing | |
code. These techniques may be applied at compile-time or on an application binary. | |
enables: | |
- &harden # Anchor this object | |
'@id': Harden | |
rdfs:label: | |
- '@value': Application Hardening | |
rdfs:subClassOf: | |
- '@id': DefensiveTechnique | |
- &enables-harden-restriction | |
'@type': | |
- owl:Restriction | |
owl:onProperty: | |
- '@id': enables | |
owl:someValuesFrom: | |
- *harden | |
- '@id': :PlatformHardening | |
'@type': *defensiveTechniqueClassess # reference to the above list | |
d3fend-id: | |
- '@value': D3-PH | |
definition: | |
- '@value': Platform Hardening ... | |
enables: | |
- *harden | |
rdfs:label: | |
- '@value': Platform Hardening | |
rdfs:subClassOf: | |
- '@id': DefensiveTechnique | |
- *enables-harden-restriction # Reference anchor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment