Git Product home page Git Product logo

case-mapping-template-stubs's Introduction

[FOLDERS]

  1. \templates is generated by case_utils ontology and sub-ontologies alone.

[INSTALL & SETUP]:

  1. pip install -r requirements.txt

[USAGE/RUN]

  • generate.py [-o: default: uses case_util's case ontology and sub ontologies,-s:Optional[],--output:default="templates", -a:default = False, -t:default = False]
    • "-o", ontology directory or string of directories delimited by "," , required.
    • "-s", specify a class by name that has at least one property, Optional. The name must be conventional to the original vocabulary eg. observable, tool, action, etc.
    • "--output", specify a specific directory to put the stubs, Optional, default = "templates"
    • "-a" True/False whether to allow case_utils to load in uco or not. The generated object will differ depending on what is within the graph. default = False.
    • "-t" True/False whether to generate a short stub (True) or full stub (False). default = False

[EXAMPLES]

generate all case and uco objects from case_utils alone:

python generate.py

generate a specific case object

python generate.py -s investigation:Authorization

[OUTPUT]: json-ld file with additional @version key for what version of case and case_utils generated the file.

[NOTE]

  1. we load the ontology ttl files directly, implying the graph is blank. The uco ontology can be loaded via case_utils load_subclass_hierarchy. Because it loads the uco ontology as well, some of the uco ontology will be generated too due to it being present in the triple preprocessing.

  2. in generate.py, there is another 'obs_prefix' commented out which uses the direct uco ontology prefixes instead of being padded with "uco-", use it you want a stand-alone uco object with its original vocabulary prefixes: eg. case uses "uco-core" while the uco ontology uses "core".

  3. The code queries the graph for all triples with sh:property and sh:path to build the entire list, therefore classes that do not have direct properties (properties not from superclass inheritence) will not be geneated using the --short True flag. By default, the flag is set to --short False which additionally tries to pull triples that declare a subclass from a superclass, thereby adding superclass properties to the stub.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.