The Knowledge Graph
Understanding GlyphNet's structured knowledge representation.
Overview
GlyphNet's knowledge graph is a structured database of concepts and their relationships:
┌─────────────────────────────────────────────────────────┐
│ KNOWLEDGE GRAPH │
├─────────────────────────────────────────────────────────┤
│ 30,000+ Concepts │
│ 80,000+ Relations │
│ 10 Canonical Relation Types │
│ 384-dimensional Embeddings │
└─────────────────────────────────────────────────────────┘Concepts
A concept is a node in the graph representing a distinct entity or idea:
┌──────────────────────────────────────┐
│ Concept: "chair" │
├──────────────────────────────────────┤
│ ID: G-00142 │
│ Type: PhysicalObject │
│ Definition: A piece of furniture │
│ designed for sitting │
│ Embedding: [0.12, -0.34, ...] │
└──────────────────────────────────────┘Concept Types
| Type | Description | Examples |
|---|---|---|
| PhysicalObject | Tangible items | chair, car, book |
| AbstractConcept | Ideas and concepts | justice, time, love |
| Action | Verbs and activities | run, build, think |
| Property | Attributes | red, heavy, fast |
| Location | Places | Paris, ocean, kitchen |
| Organization | Groups | Google, UN, NASA |
| Person | Individuals | Einstein, Shakespeare |
| Event | Occurrences | World War II, Olympics |
Relations
Relations are typed edges connecting concepts:
[chair]
│
┌────┴────┬─────────┬──────────┐
│ is_a │ has_part│ made_of │ affords_action
▼ ▼ ▼ ▼
[furniture] [legs] [wood] [sit]The 10 Canonical Relations
| Relation | Description | Example |
|---|---|---|
is_a | Type/category | dog is_a mammal |
has_part | Components | car has_part engine |
made_of | Material composition | table made_of wood |
requires | Prerequisites | fire requires oxygen |
produces | Outputs/effects | tree produces oxygen |
similar_to | Semantic similarity | couch similar_to sofa |
has_property | Attributes | snow has_property white |
affords_action | Possible actions | ball affords_action throw |
typical_location | Common places | fish typical_location water |
semantic_related | General relation | music semantic_related emotion |
Relation Strength
Each relation has a strength value:
{
"source": "chair",
"target": "furniture",
"relation": "is_a",
"strength": "primary",
"confidence": 0.98
}| Strength | Confidence Range | Meaning |
|---|---|---|
| primary | 0.90 - 1.00 | Definitive relationship |
| secondary | 0.70 - 0.89 | Strong relationship |
| tertiary | 0.50 - 0.69 | Moderate relationship |
| weak | 0.30 - 0.49 | Possible relationship |
Graph Traversal
Verification uses graph traversal to find supporting evidence:
Direct Match
Claim: "Dogs are mammals"
Traversal:
dog ──is_a──> mammal ✓
Result: Direct match, high confidenceMulti-Hop Inference
Claim: "Poodles are animals"
Traversal:
poodle ──is_a──> dog ──is_a──> mammal ──is_a──> animal ✓
Result: 3-hop path, good confidence (decreases with hops)Multiple Paths
Claim: "Water is essential for life"
Path 1: water ──requires──> life
Path 2: life ──requires──> water
Path 3: water ──produces──> hydration ──requires──> life
Result: Multiple supporting paths, very high confidenceSemantic Embeddings
Each concept has a 384-dimensional vector embedding:
# Conceptual representation
embeddings = {
"dog": [0.12, -0.34, 0.56, ..., 0.23], # 384 dims
"cat": [0.11, -0.31, 0.52, ..., 0.21], # Similar to dog
"car": [-0.45, 0.67, -0.12, ..., 0.89], # Very different
}Similarity Computation
def cosine_similarity(a, b):
return np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b))
similarity("dog", "cat") # 0.85 - related animals
similarity("dog", "puppy") # 0.92 - very similar
similarity("dog", "car") # 0.12 - unrelatedGraph Statistics
| Metric | Value |
|---|---|
| Total concepts | 30,000+ |
| Total relations | 80,000+ |
| Average connections per concept | 8.5 |
| Maximum path depth | 6 hops |
| Embedding dimensions | 384 |
Knowledge Sources
The graph is built from:
-
Curated Knowledge Bases
- Structured encyclopedic content
- Verified reference materials
- Academic sources
-
Quality-Controlled Expansion
- AI-assisted generation with human review
- Consistency validation
- Cross-reference verification
-
Ongoing Updates
- Regular knowledge refreshes
- Error corrections
- Coverage expansion
Graph Quality Assurance
Validation Rules
Every concept must pass:
validation_rules = {
"id_format": r"G-\d{5}", # ID must be G-XXXXX
"label_format": r"^[a-z_]+$", # Lowercase with underscores
"definition_length": (20, 500), # 20-500 characters
"min_relations": 1, # At least one relation
"max_parts": 25, # Maximum 25 has_part relations
}Consistency Checks
- No circular
is_arelationships has_partrelationships are acyclic- Symmetric relations are bidirectional
- Confidence scores within valid range
Using Graph Information
Query Concept Details
response = requests.get(
"https://api.glyphnet.io/v1/concepts/dog",
headers={"X-API-Key": API_KEY}
)
concept = response.json()
# {
# "id": "G-00089",
# "label": "dog",
# "type": "PhysicalObject",
# "definition": "A domesticated carnivorous mammal...",
# "relations": [
# {"type": "is_a", "target": "mammal", "confidence": 0.98},
# {"type": "has_part", "target": "tail", "confidence": 0.95},
# ...
# ]
# }Find Related Concepts
response = requests.get(
"https://api.glyphnet.io/v1/concepts/dog/related",
headers={"X-API-Key": API_KEY},
params={"relation": "is_a", "depth": 2}
)
related = response.json()
# ["mammal", "animal", "canine", "pet", ...]Limitations
Coverage Gaps
- Very specialized domains (advanced physics, rare diseases)
- Recent events (< 30 days)
- Fictional content (intentionally excluded)
- Highly localized knowledge
Update Frequency
- Core knowledge: Updated weekly
- Trending topics: Updated daily
- Breaking news: Not real-time