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

Modified CTI example #5

Merged
merged 76 commits into from
Jun 29, 2023
Merged

Modified CTI example #5

merged 76 commits into from
Jun 29, 2023

Conversation

SullivanDaly
Copy link
Contributor

@SullivanDaly SullivanDaly commented Jun 26, 2023

What is the goal of this PR?

This PR modifies the CTI example to demonstrate TypeDB's capabilities in a CTI environment.

What are the changes implemented in this PR?

Large number of improvements and optimisations to examples.

@typedb-bot
Copy link
Member

typedb-bot commented Jun 26, 2023

PR Review Checklist

Do not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed.


Trivial Change

  • This change is trivial and does not require a code or architecture review.

Code

  • Packages, classes, and methods have a single domain of responsibility.
  • Packages, classes, and methods are grouped into cohesive and consistent domain model.
  • The code is canonical and the minimum required to achieve the goal.
  • Modules, libraries, and APIs are easy to use, robust (foolproof and not errorprone), and tested.
  • Logic and naming has clear narrative that communicates the accurate intent and responsibility of each module (e.g. method, class, etc.).
  • The code is algorithmically efficient and scalable for the whole application.

Architecture

  • Any required refactoring is completed, and the architecture does not introduce technical debt incidentally.
  • Any required build and release automations are updated and/or implemented.
  • Any new components follows a consistent style with respect to the pre-existing codebase.
  • The architecture intuitively reflects the application domain, and is easy to understand.
  • The architecture has a well-defined hierarchy of encapsulated components.
  • The architecture is extensible and scalable.

Copy link
Contributor

@james-whiteside james-whiteside left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good in general, with a number of corrections for clarity/grammar.

With regards to structure of examples, try and phrase each example in natural language, and then state the query, for example:

# Let's write a query to find out which malware is used by the hacker Neo:

match
$h isa hacker, has name "Neo";
$m isa malware, has id $id;
(hacker: $h, malware: $m) isa uses;

If the query is particularly complex then you can add more context, but showing how to ask a given business question or perform a given business process is the goal. When it comes to the exercises, try and state the goal in natural language as well. It's then the user's task to translate that into TypeQL, with the keyword/type hints providing assistance.

I've provided a few suggestions of natural language for some examples. Feel free to use them or not, you know the domain better than I do.

README.md Outdated Show resolved Hide resolved
cyber-threat-intelligence/README.md Outdated Show resolved Hide resolved
cyber-threat-intelligence/README.md Outdated Show resolved Hide resolved
cyber-threat-intelligence/README.md Outdated Show resolved Hide resolved
cyber-threat-intelligence/README.md Outdated Show resolved Hide resolved
cyber-threat-intelligence/examples/06-uses-chain.tql Outdated Show resolved Hide resolved
cyber-threat-intelligence/examples/06-uses-chain.tql Outdated Show resolved Hide resolved
cyber-threat-intelligence/examples/exercise-solutions.tql Outdated Show resolved Hide resolved
SullivanDaly and others added 14 commits June 27, 2023 16:51
Co-authored-by: James Whiteside <[email protected]>
Copy link
Contributor

@james-whiteside james-whiteside left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very close! But sorry one more round. In general it's coming together very nicely. In addition to the comments I've made, please change all the underscores to hyphens in all queries and comments (except in string literals obviously).

cyber-threat-intelligence/examples/01-list-id_unknown.tql Outdated Show resolved Hide resolved
cyber-threat-intelligence/examples/04-assign-target.tql Outdated Show resolved Hide resolved
cyber-threat-intelligence/examples/05-infered-uses.tql Outdated Show resolved Hide resolved
cyber-threat-intelligence/examples/05-infered-uses.tql Outdated Show resolved Hide resolved
@james-whiteside james-whiteside changed the title Modifying CTI example. Modified CTI example Jun 29, 2023
@james-whiteside james-whiteside merged commit f4d8eef into typedb:master Jun 29, 2023
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 this pull request may close these issues.

4 participants