Λογότυπο Pid To Kg

Pid To Kg

Κοινότητα
ScottDuncanAI
pid-to-kg

Μετατρέπει P&ID (διαγράμματα σωληνώσεων και οργάνων) και PFD σε μορφή PDF, είτε διανυσματικά είτε σαρωμένα, σε γράφο γνώσης διεργασιών που καλύπτει τις συνδέσεις εξοπλισμού (ανάντη/κατάντη), τις θέσεις των οργάνων και τις μετρούμενες μεταβλητές, καθώς και τους βρόχους ελέγχου. Η έξοδος περιλαμβάνει JSON, αρχείο DuckDB, σύνοψη Markdown έτοιμη για LLM και επικυρωμένο αρχείο XML DEXPI 2.0.1. Χρησιμοποιήστε το όταν θέλετε να ψηφιοποιήσετε, να εξαγάγετε ή να αναλύσετε δεδομένα ή να δημιουργήσετε γράφο γνώσης ή επίπεδο πλαισίου από P&ID, ή όταν ρωτάτε τι βρίσκεται ανάντη/κατάντη ενός εξοπλισμού, ποιοι αισθητήρες μετρούν τι ή πώς είναι δομημένοι οι βρόχοι ελέγχου μιας μονάδας.

Επισκόπηση

ΕκδότηςScottDuncanAI
ΑποθετήριοPID-to-Knowledge-Graph
Όνομα δεξιότηταςpid-to-kg
Αστέρια
505
Διακλαδώσεις
119
Συνοδευτικά αρχεία
37
Άδεια χρήσηςMIT
Σύνδεσμοι
  • Οδηγίες σε Markdown

    Ένα αρχείο SKILL.md που το μοντέλο φορτώνει όταν χρειάζεται, ώστε να καταναλώνει token μόνο όταν ένα αίτημα είναι πράγματι σχετικό.

  • Λειτουργεί με οποιοδήποτε LLM

    Οι δεξιότητες AI είναι απλό Markdown, όχι κώδικας για συγκεκριμένο πάροχο, επομένως αυτή η δεξιότητα λειτουργεί με GPT, Claude, Gemini, Grok ή ένα τοπικό μοντέλο.

  • Συνοδευτικά αρχεία: 37

    Αρχεία script, πρότυπα και υλικό αναφοράς που μπορεί να διαβάζει το μοντέλο καθώς εργάζεται. Τα αρχεία είναι μόνο για ανάγνωση και δεν εκτελούνται ποτέ.

  • Ανοιχτού κώδικα

    Δημοσιεύτηκε στο GitHub από τον λογαριασμό ScottDuncanAI. Ελέγξτε τα αρχεία της δεξιότητας στο αποθετήριο πριν την εγκαταστήσετε.

Εγκατάσταση

Εγκαταστήστε τη δεξιότητα AI Pid To Kg στο TypingMind για να τη χρησιμοποιείτε με οποιοδήποτε LLM ή προσθέστε τη σε άλλον πράκτορα AI που διαβάζει αρχεία SKILL.md.

1

Εγκατάσταση στο TypingMind

Το TypingMind εγκαθιστά μια δεξιότητα απευθείας από τον φάκελό της στο GitHub — διαβάζει το SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία σε πακέτο και αποθηκεύει το αποτέλεσμα τοπικά.

  1. Ανοίξτε την εφαρμογή και μεταβείτε στα Πρόσθετα → Δεξιότητες.
  2. Επιλέξτε «Εγκατάσταση από GitHub».
  3. Επικολλήστε το παρακάτω URL του φακέλου της δεξιότητας και επιβεβαιώστε.
    https://github.com/ScottDuncanAI/PID-to-Knowledge-Graph/tree/main/skills/pid-to-kg
  4. Ενεργοποιήστε τη δεξιότητα σε κάθε συνομιλία όπου θέλετε να είναι διαθέσιμη.
Πρόσθετα → Δεξιότητες → Προσθήκη δεξιότητας → Από URL του GitHub, έπειτα επικολλήστε το URL του φακέλου και πατήστε «Συνέχεια».
2

Εγκατάσταση σε άλλον πράκτορα AI

Κάθε πράκτορας AI που υποστηρίζει τη μορφή Agent Skills μπορεί να χρησιμοποιήσει αυτή τη δεξιότητα — αντιγράψτε τον φάκελο στον κατάλογο δεξιοτήτων του.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ScottDuncanAI/PID-to-Knowledge-Graph.git /tmp/PID-to-Knowledge-Graph
mkdir -p .claude/skills
cp -r /tmp/PID-to-Knowledge-Graph/skills/pid-to-kg .claude/skills/pid-to-kg
Επανεκκινήστε το Claude Code μετά την αντιγραφή, ώστε να εντοπίσει τη νέα δεξιότητα.

Χρησιμοποιήστε τη στο TypingMind

Ενεργοποιήστε τη δεξιότητα Pid To Kg σε οποιαδήποτε συνομιλία στο TypingMind και το μοντέλο αναλαμβάνει τα υπόλοιπα. Το όνομα και η περιγραφή της περιλαμβάνονται στην προτροπή συστήματος και, μόλις προκύψει ένα σχετικό αίτημα, το μοντέλο φορτώνει μόνο του τις πλήρεις οδηγίες — δεν χρειάζεται ποτέ να την καλείτε χειροκίνητα και δεν καταναλώνει token μέχρι να χρησιμοποιηθεί πραγματικά.

Το μοντέλο φορτώνει αυτόματα τη δεξιότητα Pid To Kg μόλις λάβει ένα σχετικό αίτημα.

Λειτουργεί με οποιοδήποτε μοντέλο AI

Οι δεξιότητες AI είναι οδηγίες σε απλό κείμενο Markdown και όχι κώδικας για συγκεκριμένο πάροχο, οπότε η δεξιότητα Pid To Kg δεν περιορίζεται στο μοντέλο για το οποίο γράφτηκε. Εγκαταστήστε τη μία φορά στο TypingMind και χρησιμοποιήστε τη με GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ή ένα τοπικό μοντέλο που εκτελείτε εσείς — πάντα με τα δικά σας κλειδιά API.

  • Φόρτωση μόνο όταν χρειάζεται

    Η προτροπή συστήματος περιλαμβάνει μόνο το όνομα και την περιγραφή. Οι οδηγίες ανακτώνται με το πρώτο σχετικό αίτημα, οπότε μια δεξιότητα που δεν χρησιμοποιείται δεν έχει κόστος.

  • Αλλάξτε μοντέλο κατά τη διάρκεια της συνομιλίας

    Επειδή η δεξιότητα αποτελείται από οδηγίες και όχι από κώδικα, η αλλαγή μοντέλου δεν επηρεάζει τη λειτουργία της — το επόμενο μοντέλο διαβάζει το ίδιο αρχείο SKILL.md.

Οδηγίες δεξιότητας

Αυτό είναι το περιεχόμενο του αρχείου SKILL.md που φορτώνει το μοντέλο. Διαβάστε το πριν από την εγκατάσταση — μια δεξιότητα αποτελείται από οδηγίες που θα ακολουθήσει το μοντέλο σας.

P&ID to knowledge graph

Work is split between deterministic scripts and you:

  • Scripts classify pages (vector vs scanned), render them into readable tiles, collect OCR/text hints, then build, check, store and query the graph.
  • You read the drawings and write one structured extraction file per sheet. Symbol recognition and line tracing are visual reasoning, and that is the part scripts cannot do well.

All scripts are in scripts/ next to this file. Call them by their full path (the commands below abbreviate it as scripts/), and keep the work directory in the user's current folder, e.g. work/<plant>.

Setup. Many users are engineers, not programmers, so handle setup yourself. The scripts need Python 3.10+. Before the first run, install the dependencies with pip install -r <skill dir>/scripts/requirements.txt (use a virtual environment if the user's Python is shared with other work). If Python is missing, tell the user to install it from python.org and stop there.

Ground rules

  • Only the P&ID pages. Drawings often sit inside a long permit or design report. If the user names the pages, pass them with --pages. If not, and the PDF has more than a few pages, probe it, look at the page overviews or ask the user, then re-run the probe with --pages so later steps skip reports, legends and non-P&ID drawings.
  • One plant, one work directory, one graph. Never put sheets from different plants in the same work directory: tags would merge across unrelated plants. If the user supplies several plants, run the whole workflow separately for each.
  • One configuration per graph. If the PDF contains two revisions of the same drawing (same title or area, overlapping tags, e.g. an as-built and an older draft), do not merge them. Ask the user which revision to use, extract only that one, and record the excluded pages and the reason in the report. QA flags likely duplicates as possible_duplicate_revision. Record each sheet's issue_status from the title block or stamps.
  • Record only what is drawn. Never invent tags, connections or loops to make the graph look complete. Anything unclear goes in with a lower confidence, or into unreadable.
  • The QA loop is not optional. Rebuild until there are no errors, and re-check every warning on the drawing.

Workflow

Copy this checklist into your notes and tick it off:

- [ ] 1. Probe:    python scripts/probe_pdf.py <pdf> --work <work> --plant-name "<name>" [--pages 47-60]
- [ ] 2. Render:   python scripts/render_pages.py <work>
- [ ] 3. Orient:   open each pages/page_NN/overview_grid.png; fix rotation if text is not upright
- [ ] 4. Hints:    python scripts/make_hints.py <work>
- [ ] 5. Extract:  for each sheet, write <work>/extract/page_NN.json (references/extraction_procedure.md)
- [ ] 6. Build:    python scripts/build_kg.py <work>
- [ ] 7. QA loop:  fix every error, re-check every warning, rebuild (repeat)
- [ ] 8. Report:   summarize the results and open issues for the user

1. Probe

probe_pdf.py assigns each page a class and an extraction route, and writes <work>/manifest.json. With --pages, the later steps render and read only those pages.

ClassWhat it meansRoute
vector_textVector drawing with a text layerRender from vectors; exact text from the text layer as hints
vector_outlinedVector drawing, text drawn as outlines (no text layer)High-resolution vector render; OCR hints
rasterScanned imageNative-resolution render, upscaled and contrast-enhanced; OCR hints
raster_with_textScan with an OCR text layerAs raster; text layer as (untrusted) hints
hybridVectors plus large imagesBoth routes

Report the probe result to the user in one line, e.g. "14 vector sheets with outlined text."

Low scan resolution is flagged in the notes. Expect to record more items in unreadable on those sheets.

2–3. Render and check orientation

render_pages.py writes the following for each page:

  • overview.png
  • overview_grid.png, which shows the tile names
  • overlapping tiles in tiles/
  • tiles.json, which records which tiles are blank

Orientation is detected with OCR when it is installed. Always confirm it on overview_grid.png. If the main drawing text is not upright, re-render that page with an explicit rotation, given clockwise: render_pages.py <work> --pages N --rotation 90.

Title blocks are sometimes rotated differently from the drawing. Orient by the drawing labels, not by the title block.

4. Hints

make_hints.py writes hints/page_NN.json. Each file holds candidate tags with page positions, taken from the text layer or from OCR. They are only hints: OCR misreads, and it misses things. You don't need to read the hint files during extraction. QA uses them to flag tags you may have missed. If OCR is not installed the step is skipped; note this in the final report.

5. Extract each sheet

This is the core of the job. Follow references/extraction_procedure.md exactly. It covers:

  • the reading order: overview, then every non-blank tile, then zoomed crops
  • how to model pipe runs, tees, taps, signals and off-page connectors
  • confidence calibration
  • a self-check list to run before saving

Reference material, to read when needed:

Write extract/page_NN.json and save it before starting the next sheet, so a long job never holds more than one sheet in context. With many sheets, and if your environment supports subagents, you can extract sheets in parallel. Give each subagent the procedure file and its own page directory.

6–7. Build and the QA loop

build_kg.py validates every page file and stops with a precise message on schema errors. It then writes these files to <work>/kg/:

  • graph.json
  • graph.duckdb
  • summary.md
  • qa_report.md
  • graph.dexpi.xml, the DEXPI 2.0.1 native XML export. It is written only when it passes both the official XSD and the DEXPI model check
  • dexpi_export_report.md, which gives the validation result and everything DEXPI could not represent

The DEXPI export runs on every build; it needs no flag or extra request. The build's last line reports it:

  • dexpi: valid DEXPI 2.0.1 ... means the file is current. If it mentions mapping warnings, the file is still valid; the report lists the items affected, such as nozzles and tees added to satisfy the DEXPI model.
  • dexpi: FAILED ... means no graph.dexpi.xml exists for this build, and any older copy was removed. The other outputs are fine. Read dexpi_export_report.md, tell the user, and do not hand over an old DEXPI file.

Work through qa_report.md:

  • Errors, such as unresolved_reference, are mistakes in the page files. Fix them and rebuild.
  • Warnings name the tiles to re-check. Look at those tiles again, or use crop.py for a zoomed view, and correct the extraction if the drawing shows something different. Common warnings:
    • instrument_not_located: a sensor with no measures
    • equipment_not_connected
    • unmatched_off_page
    • possible_missed_tags: an OCR tag that is not in your extraction
    • tiles_not_reviewed
  • A warning that turns out correct on the drawing is fine to leave. Examples: an off-page connector whose other drawing was not supplied, or an OCR misread. List these in your report.

Stop when there are no errors and every warning has been checked.

bash
python scripts/crop.py <work> --page 5 --bbox 0.40 0.20 0.55 0.35   # zoomed view of a region

8. Report

Tell the user:

  • where the outputs are
  • the headline counts (equipment, instruments, loops)
  • two or three example flow paths and loops taken from summary.md
  • what remains uncertain

Report the DEXPI status: valid, valid with mapping warnings (name the main kinds from dexpi_export_report.md), or failed. Say that the DEXPI file is semantic only, with no drawing graphics, so CAD tools will not redraw it as a P&ID.

Point to qa_report.md for the details. State plainly that the graph is machine-extracted and needs engineering review before it is used for design, operations or safety.

Using the graph

  • summary.md is the compact, token-efficient context for an LLM: equipment-level flow, an instrument table with locations, and a loop table.
  • graph.json is the canonical graph, which any tool can read.
  • graph.duckdb is for SQL. Its views are equipment, equipment_flow, instruments, loops and signals, and its table macros are upstream(id) and downstream(id).
  • graph.dexpi.xml is for DEXPI-capable engineering tools.

Use kg_query.py to answer questions; add --json when another tool will consume the output:

bash
python scripts/kg_query.py <work>/kg downstream 660-TK-001 --equipment
python scripts/kg_query.py <work>/kg upstream FV-0502
python scripts/kg_query.py <work>/kg path 660-TK-001 660-TK-004
python scripts/kg_query.py <work>/kg instruments --on 660-PP-011
python scripts/kg_query.py <work>/kg loop FIC-0502
python scripts/kg_query.py <work>/kg sql "SELECT * FROM equipment_flow"

To measure extraction quality on a sheet, hand-check it into a small gold file (format in scripts/eval_kg.py) and run python scripts/eval_kg.py <work>/kg gold.json: it reports tag, flow and loop precision/recall and instrument placement.

To move a graph into other tools: python scripts/export.py <work>/kg graphml produces a file for yEd, Gephi or NetworkX, and python scripts/export.py <work>/kg neo4j produces CSVs plus a Cypher import script. For a graph.json built before DEXPI export existed, python scripts/export.py <work>/kg dexpi writes the DEXPI file and report using the same mapping and validation as the build.

Συνοδευτικά αρχεία

Το μοντέλο τα διαβάζει όποτε χρειάζεται, όσο η δεξιότητα είναι φορτωμένη. Διατίθενται ως αρχεία για ανάγνωση και δεν εκτελούνται ποτέ.

Συχνές ερωτήσεις

Τι κάνει η δεξιότητα AI Pid To Kg;

Μετατρέπει P&ID (διαγράμματα σωληνώσεων και οργάνων) και PFD σε μορφή PDF, είτε διανυσματικά είτε σαρωμένα, σε γράφο γνώσης διεργασιών που καλύπτει τις συνδέσεις εξοπλισμού (ανάντη/κατάντη), τις θέσεις των οργάνων και τις μετρούμενες μεταβλητές, καθώς και τους βρόχους ελέγχου. Η έξοδος περιλαμβάνει JSON, αρχείο DuckDB, σύνοψη Markdown έτοιμη για LLM και επικυρωμένο αρχείο XML DEXPI 2.0.1. Χρησιμοποιήστε το όταν θέλετε να ψηφιοποιήσετε, να εξαγάγετε ή να αναλύσετε δεδομένα ή να δημιουργήσετε γράφο γνώσης ή επίπεδο πλαισίου από P&ID, ή όταν ρωτάτε τι βρίσκεται ανάντη/κατάντη ενός εξοπλισμού,...

Γιατί να χρησιμοποιήσετε τη δεξιότητα Pid To Kg στο TypingMind;

Επειδή την εγκαθιστάτε μία φορά και τη χρησιμοποιείτε με οποιοδήποτε μοντέλο. Η Pid To Kg είναι απλό Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως η ίδια δεξιότητα λειτουργεί με GPT-5, Claude, Gemini, Grok ή ένα τοπικό μοντέλο — και μπορείτε να αλλάξετε μοντέλο κατά τη διάρκεια της συνομιλίας χωρίς να διακοπεί η λειτουργία της. Το TypingMind λειτουργεί με τα δικά σας κλειδιά API, οπότε πληρώνετε απευθείας τους παρόχους αντί για συνδρομή ανά θέση χρήστη, ενώ οι δεξιότητες και οι συνομιλίες σας παραμένουν στον δικό σας χώρο αποθήκευσης.

Πώς εγκαθιστώ τη δεξιότητα Pid To Kg στο TypingMind;

Στο TypingMind, ανοίξτε Πρόσθετα → Δεξιότητες → Εγκατάσταση από το GitHub και επικολλήστε τη διεύθυνση https://github.com/ScottDuncanAI/PID-to-Knowledge-Graph/tree/main/skills/pid-to-kg. Το TypingMind διαβάζει το αρχείο SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία και εγκαθιστά τη δεξιότητα, την οποία μπορείτε να ενεργοποιείτε ανά συνομιλία.

Ποια μοντέλα AI μπορούν να χρησιμοποιήσουν τη δεξιότητα Pid To Kg;

Οποιοδήποτε μοντέλο συνδέετε στο TypingMind. Οι δεξιότητες AI είναι απλές οδηγίες Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως τα GPT, Claude, Gemini, Grok και τα τοπικά μοντέλα μπορούν όλα να φορτώσουν αυτή τη δεξιότητα όταν ένα αίτημα αντιστοιχεί σε αυτή.

Με πόσα μοντέλα AI μπορώ να χρησιμοποιήσω τη δεξιότητα Pid To Kg;

Με όσα θέλετε. Στο TypingMind μπορείτε να χρησιμοποιήσετε τη δεξιότητα Pid To Kg με οποιοδήποτε μοντέλο υποστηρίζει δεξιότητες, όπως τα GPT, Claude, Gemini, Grok, DeepSeek, Mistral και Llama, χρησιμοποιώντας τα δικά σας κλειδιά API.

Είναι δωρεάν η δεξιότητα AI Pid To Kg;

Ναι. Δημοσιεύεται στο GitHub από τον λογαριασμό ScottDuncanAI με την άδεια χρήσης MIT. Πληρώνετε μόνο τον δικό σας πάροχο AI για τα token που χρησιμοποιείτε.

Τι είναι οι δεξιότητες AI;

Μια δεξιότητα AI είναι ένα επαναχρησιμοποιήσιμο πακέτο οδηγιών που διδάσκει σε ένα μοντέλο AI πώς να εκτελεί μια συγκεκριμένη εργασία. Ακολουθεί την ανοιχτή μορφή Agent Skills: ένα αρχείο SKILL.md με όνομα και περιγραφή, μαζί με τυχόν σενάρια κώδικα, πρότυπα ή αρχεία αναφοράς που μπορεί να χρειαστεί το μοντέλο. Το μοντέλο διαβάζει τις οδηγίες μόνο όταν το αίτημά σας αντιστοιχεί στη δεξιότητα, οπότε μια εγκατεστημένη δεξιότητα δεν κοστίζει τίποτα μέχρι να χρησιμοποιηθεί.

Σε τι διαφέρουν οι δεξιότητες AI από τα πρόσθετα ή τους συνδέσμους MCP;

Ένα πρόσθετο ή ένας σύνδεσμος MCP παρέχει στο μοντέλο νέα εργαλεία που μπορεί να καλέσει — κώδικα που εκτελείται κάπου και επιστρέφει ένα αποτέλεσμα. Μια δεξιότητα AI παρέχει αντί γι’ αυτό γνώσεις και διαδικασίες στο μοντέλο: πώς να προσεγγίσει μια εργασία, ποια βήματα να ακολουθήσει και ποια χαρακτηριστικά έχει ένα καλό αποτέλεσμα. Οι δεξιότητες είναι απλό Markdown, επομένως δεν χρειάζονται διακομιστή, κλειδί API ή περιβάλλον εκτέλεσης και λειτουργούν με οποιοδήποτε μοντέλο.

Προβολή όλων

Δημιουργήστε τώρα τον δικό σας χώρο εργασίας AI

Εγγραφείτε στο ενημερωτικό μας δελτίο για να ενημερώνεστε για νέες λειτουργίες και μελλοντικές κληρώσεις δώρων 👇