chore: import upstream snapshot with attribution
Test Suites / Build CI Environment (push) Has been cancelled
Test Suites / Basic Tests (push) Has been cancelled
Test Suites / End-to-End Tests (push) Has been cancelled
Test Suites / CLI Tests (push) Has been cancelled
Test Suites / Slow End-to-End Tests (push) Has been cancelled
Test Suites / Graph Database Tests (push) Has been cancelled
Test Suites / Vector DB Tests (push) Has been cancelled
Test Suites / Temporal Graph Test (push) Has been cancelled
Test Suites / Search Test on Different DBs (push) Has been cancelled
Test Suites / Example Tests (push) Has been cancelled
Test Suites / Notebook Tests (push) Has been cancelled
Test Suites / OS and Python Tests Ubuntu (push) Has been cancelled
Test Suites / OS and Python Tests Extended (push) Has been cancelled
Test Suites / LLM Test Suite (push) Has been cancelled
Test Suites / S3 File Storage Test (push) Has been cancelled
Test Suites / Run Integration Tests (push) Has been cancelled
Test Suites / MCP Tests (push) Has been cancelled
Test Suites / Docker Compose Test (push) Has been cancelled
Test Suites / Docker CI test (push) Has been cancelled
Test Suites / Relational DB Migration Tests (push) Has been cancelled
Test Suites / Distributed Cognee Test (push) Has been cancelled
Test Suites / DB Examples Tests (push) Has been cancelled
Test Suites / Test Completion Status (push) Has been cancelled
Test Suites / Claude Code Review (push) Has been cancelled
Test Suites / basic checks (push) Has been cancelled
build | Build and Push Cognee MCP Docker Image to dockerhub / docker-build-and-push (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
build | Build and Push Docker Image to dockerhub / docker-build-and-push (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges Core Functionality (3.11) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges Core Functionality (3.12) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges with Different Graph Databases (kuzu, kuzu) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges with Different Graph Databases (neo4j, neo4j) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges Examples (push) Has been cancelled
Weighted Edges Tests / Code Quality for Weighted Edges (push) Has been cancelled
Test Suites / Build CI Environment (push) Has been cancelled
Test Suites / Basic Tests (push) Has been cancelled
Test Suites / End-to-End Tests (push) Has been cancelled
Test Suites / CLI Tests (push) Has been cancelled
Test Suites / Slow End-to-End Tests (push) Has been cancelled
Test Suites / Graph Database Tests (push) Has been cancelled
Test Suites / Vector DB Tests (push) Has been cancelled
Test Suites / Temporal Graph Test (push) Has been cancelled
Test Suites / Search Test on Different DBs (push) Has been cancelled
Test Suites / Example Tests (push) Has been cancelled
Test Suites / Notebook Tests (push) Has been cancelled
Test Suites / OS and Python Tests Ubuntu (push) Has been cancelled
Test Suites / OS and Python Tests Extended (push) Has been cancelled
Test Suites / LLM Test Suite (push) Has been cancelled
Test Suites / S3 File Storage Test (push) Has been cancelled
Test Suites / Run Integration Tests (push) Has been cancelled
Test Suites / MCP Tests (push) Has been cancelled
Test Suites / Docker Compose Test (push) Has been cancelled
Test Suites / Docker CI test (push) Has been cancelled
Test Suites / Relational DB Migration Tests (push) Has been cancelled
Test Suites / Distributed Cognee Test (push) Has been cancelled
Test Suites / DB Examples Tests (push) Has been cancelled
Test Suites / Test Completion Status (push) Has been cancelled
Test Suites / Claude Code Review (push) Has been cancelled
Test Suites / basic checks (push) Has been cancelled
build | Build and Push Cognee MCP Docker Image to dockerhub / docker-build-and-push (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
build | Build and Push Docker Image to dockerhub / docker-build-and-push (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges Core Functionality (3.11) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges Core Functionality (3.12) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges with Different Graph Databases (kuzu, kuzu) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges with Different Graph Databases (neo4j, neo4j) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges Examples (push) Has been cancelled
Weighted Edges Tests / Code Quality for Weighted Edges (push) Has been cancelled
This commit is contained in:
+324
@@ -0,0 +1,324 @@
|
||||
# ruff: noqa: E402
|
||||
import asyncio
|
||||
import os
|
||||
|
||||
import sqlalchemy as sa
|
||||
|
||||
# This example uses a local Postgres migration database and no backend ACL.
|
||||
# Set os.environ before importing Cognee: Cognee reads env-backed settings at import time, so values
|
||||
# assigned later may not override defaults or `.env`. See https://docs.cognee.ai/setup-configuration/overview#using-os-environ
|
||||
os.environ["ENABLE_BACKEND_ACCESS_CONTROL"] = "false"
|
||||
os.environ["MIGRATION_DB_PROVIDER"] = "postgres"
|
||||
os.environ.setdefault("MIGRATION_DB_HOST", "127.0.0.1")
|
||||
os.environ.setdefault("MIGRATION_DB_PORT", "5432")
|
||||
os.environ.setdefault("MIGRATION_DB_NAME", "cognee_migration")
|
||||
os.environ.setdefault("MIGRATION_DB_USERNAME", "cognee")
|
||||
os.environ.setdefault("MIGRATION_DB_PASSWORD", "cognee")
|
||||
|
||||
import cognee
|
||||
from cognee import SearchType
|
||||
from cognee.infrastructure.databases.graph import get_graph_engine
|
||||
from cognee.infrastructure.databases.relational import (
|
||||
create_db_and_tables as create_relational_db_and_tables,
|
||||
)
|
||||
from cognee.infrastructure.databases.relational import (
|
||||
get_migration_relational_engine,
|
||||
)
|
||||
from cognee.infrastructure.databases.vector.pgvector import (
|
||||
create_db_and_tables as create_vector_db_and_tables,
|
||||
)
|
||||
from cognee.modules.ontology.ontology_config import Config
|
||||
from cognee.modules.ontology.rdf_xml.RDFLibOntologyResolver import RDFLibOntologyResolver
|
||||
from cognee.run_migrations import run_migrations
|
||||
from cognee.tasks.ingestion import migrate_relational_database
|
||||
|
||||
CAR_MANUFACTURERS = [
|
||||
(
|
||||
"Audi",
|
||||
"German car manufacturer known for engineering and the Quattro all-wheel drive system.",
|
||||
),
|
||||
(
|
||||
"BMW",
|
||||
"German car manufacturer focused on performance and driving pleasure.",
|
||||
),
|
||||
(
|
||||
"Mercedes-Benz",
|
||||
"German car manufacturer known for luxury sedans, SUVs, and commercial vehicles.",
|
||||
),
|
||||
(
|
||||
"Porsche",
|
||||
"German car manufacturer specializing in high-performance sports cars like the 911.",
|
||||
),
|
||||
(
|
||||
"Volkswagen",
|
||||
"German car manufacturer known for mass-market vehicles like the Golf.",
|
||||
),
|
||||
]
|
||||
|
||||
IT_COMPANIES = [
|
||||
(
|
||||
"Apple",
|
||||
"Technology company known for consumer electronics and software such as iPhone and macOS.",
|
||||
),
|
||||
(
|
||||
"Google",
|
||||
"Technology company known for search, Android, and cloud services.",
|
||||
),
|
||||
(
|
||||
"Microsoft",
|
||||
"Technology company known for Windows, Office, and Azure cloud services.",
|
||||
),
|
||||
(
|
||||
"Amazon",
|
||||
"Technology company known for e-commerce and AWS cloud services.",
|
||||
),
|
||||
(
|
||||
"Meta",
|
||||
"Technology company known for social platforms and virtual reality products.",
|
||||
),
|
||||
]
|
||||
|
||||
PRODUCTS = [
|
||||
# Car products
|
||||
("Audi", "A4", "car", "sedan", 40000, 2023, "Audi A4 sedan with advanced safety features."),
|
||||
(
|
||||
"BMW",
|
||||
"3 Series",
|
||||
"car",
|
||||
"sedan",
|
||||
42000,
|
||||
2023,
|
||||
"BMW 3 Series sports sedan focused on driving dynamics.",
|
||||
),
|
||||
(
|
||||
"Mercedes-Benz",
|
||||
"C-Class",
|
||||
"car",
|
||||
"sedan",
|
||||
45000,
|
||||
2023,
|
||||
"Mercedes-Benz C-Class luxury sedan.",
|
||||
),
|
||||
(
|
||||
"Porsche",
|
||||
"911",
|
||||
"car",
|
||||
"sports car",
|
||||
120000,
|
||||
2024,
|
||||
"Porsche 911 high-performance sports car.",
|
||||
),
|
||||
("Volkswagen", "Golf", "car", "hatchback", 27000, 2022, "Volkswagen Golf compact hatchback."),
|
||||
# IT products
|
||||
("Apple", "iPhone", "device", "smartphone", 999, 2023, "Apple iPhone smartphone."),
|
||||
("Google", "Pixel", "device", "smartphone", 899, 2023, "Google Pixel smartphone."),
|
||||
("Microsoft", "Surface", "device", "laptop", 1199, 2022, "Microsoft Surface laptop."),
|
||||
("Amazon", "Kindle", "device", "e-reader", 139, 2021, "Amazon Kindle e-reader."),
|
||||
("Meta", "Quest", "device", "vr headset", 499, 2022, "Meta Quest VR headset."),
|
||||
]
|
||||
|
||||
|
||||
def _get_postgres_engine() -> sa.Engine:
|
||||
# Requires a running Postgres database and a pre-created database (db_name).
|
||||
# URL.create safely encodes credentials that contain URL-reserved characters.
|
||||
connection_url = sa.URL.create(
|
||||
"postgresql+psycopg2",
|
||||
username=os.environ["MIGRATION_DB_USERNAME"],
|
||||
password=os.environ["MIGRATION_DB_PASSWORD"],
|
||||
host=os.environ["MIGRATION_DB_HOST"],
|
||||
port=int(os.environ["MIGRATION_DB_PORT"]),
|
||||
database=os.environ["MIGRATION_DB_NAME"],
|
||||
)
|
||||
return sa.create_engine(connection_url)
|
||||
|
||||
|
||||
def create_example_postgres_db() -> None:
|
||||
engine = _get_postgres_engine()
|
||||
|
||||
with engine.begin() as conn:
|
||||
conn.execute(
|
||||
sa.text(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS companies (
|
||||
id SERIAL PRIMARY KEY,
|
||||
name TEXT UNIQUE NOT NULL,
|
||||
company_type TEXT NOT NULL
|
||||
);
|
||||
"""
|
||||
)
|
||||
)
|
||||
conn.execute(
|
||||
sa.text(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS car_manufacturers (
|
||||
id SERIAL PRIMARY KEY,
|
||||
company_id INTEGER UNIQUE NOT NULL REFERENCES companies(id),
|
||||
name TEXT UNIQUE NOT NULL,
|
||||
description TEXT NOT NULL
|
||||
);
|
||||
"""
|
||||
)
|
||||
)
|
||||
conn.execute(
|
||||
sa.text(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS it_companies (
|
||||
id SERIAL PRIMARY KEY,
|
||||
company_id INTEGER UNIQUE NOT NULL REFERENCES companies(id),
|
||||
name TEXT UNIQUE NOT NULL,
|
||||
description TEXT NOT NULL
|
||||
);
|
||||
"""
|
||||
)
|
||||
)
|
||||
conn.execute(
|
||||
sa.text(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS products (
|
||||
id SERIAL PRIMARY KEY,
|
||||
company_id INTEGER NOT NULL REFERENCES companies(id),
|
||||
name TEXT NOT NULL,
|
||||
product_type TEXT NOT NULL,
|
||||
category TEXT NOT NULL,
|
||||
price_usd INTEGER NOT NULL,
|
||||
release_year INTEGER NOT NULL,
|
||||
description TEXT NOT NULL
|
||||
);
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
# Reset tables for a clean run (handle FK constraints).
|
||||
conn.execute(
|
||||
sa.text("TRUNCATE TABLE products, car_manufacturers, it_companies, companies CASCADE;")
|
||||
)
|
||||
|
||||
conn.execute(
|
||||
sa.text("INSERT INTO companies (name, company_type) VALUES (:name, :company_type);"),
|
||||
[{"name": name, "company_type": "car"} for name, _ in CAR_MANUFACTURERS]
|
||||
+ [{"name": name, "company_type": "it"} for name, _ in IT_COMPANIES],
|
||||
)
|
||||
|
||||
conn.execute(
|
||||
sa.text(
|
||||
"""
|
||||
INSERT INTO car_manufacturers (company_id, name, description)
|
||||
SELECT c.id, :name, :description
|
||||
FROM companies c
|
||||
WHERE c.name = :name;
|
||||
"""
|
||||
),
|
||||
[{"name": name, "description": desc} for name, desc in CAR_MANUFACTURERS],
|
||||
)
|
||||
conn.execute(
|
||||
sa.text(
|
||||
"""
|
||||
INSERT INTO it_companies (company_id, name, description)
|
||||
SELECT c.id, :name, :description
|
||||
FROM companies c
|
||||
WHERE c.name = :name;
|
||||
"""
|
||||
),
|
||||
[{"name": name, "description": desc} for name, desc in IT_COMPANIES],
|
||||
)
|
||||
conn.execute(
|
||||
sa.text(
|
||||
"""
|
||||
INSERT INTO products (
|
||||
company_id, name, product_type, category, price_usd, release_year, description
|
||||
) VALUES (
|
||||
(SELECT id FROM companies WHERE name = :company_name),
|
||||
:name, :product_type, :category, :price_usd, :release_year, :description
|
||||
);
|
||||
"""
|
||||
),
|
||||
[
|
||||
{
|
||||
"company_name": company,
|
||||
"name": name,
|
||||
"product_type": product_type,
|
||||
"category": category,
|
||||
"price_usd": price_usd,
|
||||
"release_year": release_year,
|
||||
"description": description,
|
||||
}
|
||||
for company, name, product_type, category, price_usd, release_year, description in PRODUCTS
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
def fetch_texts_from_postgres() -> list[str]:
|
||||
engine = _get_postgres_engine()
|
||||
with engine.connect() as conn:
|
||||
rows = conn.execute(
|
||||
sa.text(
|
||||
"""
|
||||
SELECT name || ': ' || description FROM car_manufacturers
|
||||
UNION ALL
|
||||
SELECT name || ': ' || description FROM it_companies
|
||||
UNION ALL
|
||||
SELECT name || ': ' || description FROM products;
|
||||
"""
|
||||
)
|
||||
).fetchall()
|
||||
return [row[0] for row in rows if row and row[0]]
|
||||
|
||||
|
||||
async def main(ontology_path: str = None):
|
||||
# Create a small Postgres DB schema to migrate.
|
||||
create_example_postgres_db()
|
||||
|
||||
# Ensure a reused local Cognee DB matches the current models before cleanup.
|
||||
await create_relational_db_and_tables()
|
||||
await run_migrations()
|
||||
await cognee.forget(everything=True)
|
||||
|
||||
await create_vector_db_and_tables()
|
||||
|
||||
engine = get_migration_relational_engine()
|
||||
schema = await engine.extract_schema()
|
||||
|
||||
graph = await get_graph_engine()
|
||||
await migrate_relational_database(graph, schema=schema)
|
||||
|
||||
# Second pass: remember text content from the relational DB (optional ontology).
|
||||
dataset_name = "migration_texts"
|
||||
db_texts = fetch_texts_from_postgres()
|
||||
|
||||
if ontology_path:
|
||||
graph_visualization_path = os.path.join(
|
||||
os.path.dirname(__file__), ".artifacts", "complex_relational_db_ont.html"
|
||||
)
|
||||
config: Config = {
|
||||
"ontology_config": {
|
||||
"ontology_resolver": RDFLibOntologyResolver(ontology_file=ontology_path)
|
||||
}
|
||||
}
|
||||
await cognee.remember(
|
||||
db_texts,
|
||||
dataset_name=dataset_name,
|
||||
config=config,
|
||||
self_improvement=False,
|
||||
)
|
||||
else:
|
||||
graph_visualization_path = os.path.join(
|
||||
os.path.dirname(__file__), ".artifacts", "complex_relational_db_no_ont.html"
|
||||
)
|
||||
await cognee.remember(db_texts, dataset_name=dataset_name, self_improvement=False)
|
||||
|
||||
results = await cognee.recall(
|
||||
query_type=SearchType.GRAPH_COMPLETION,
|
||||
query_text="Which companies are mentioned?",
|
||||
top_k=50,
|
||||
)
|
||||
print(results)
|
||||
await cognee.visualize_graph(graph_visualization_path)
|
||||
|
||||
|
||||
async def _run():
|
||||
await main(ontology_path="data/basic_ontology.owl")
|
||||
await main()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(_run())
|
||||
@@ -0,0 +1,290 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<rdf:RDF
|
||||
xmlns:ns1="http://example.org/ontology#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
|
||||
>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Volkswagen">
|
||||
<rdfs:comment>Created for making cars accessible to everyone.</rdfs:comment>
|
||||
<ns1:produces rdf:resource="http://example.org/ontology#VW_Golf"/>
|
||||
<ns1:produces rdf:resource="http://example.org/ontology#VW_ID4"/>
|
||||
<ns1:produces rdf:resource="http://example.org/ontology#VW_Touareg"/>
|
||||
<rdf:type rdf:resource="http://example.org/ontology#CarManufacturer"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Azure">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#CloudServiceProvider"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Porsche">
|
||||
<ns1:produces rdf:resource="http://example.org/ontology#Porsche_Cayenne"/>
|
||||
<ns1:produces rdf:resource="http://example.org/ontology#Porsche_Taycan"/>
|
||||
<ns1:produces rdf:resource="http://example.org/ontology#Porsche_911"/>
|
||||
<rdf:type rdf:resource="http://example.org/ontology#CarManufacturer"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
<rdfs:comment>Famous for high-performance sports cars.</rdfs:comment>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Meta">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#TechnologyCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#Instagram"/>
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#Facebook"/>
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#Oculus"/>
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#WhatsApp"/>
|
||||
<rdfs:comment>Pioneering social media and virtual reality technology.</rdfs:comment>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#TechnologyCompany">
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Apple">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#TechnologyCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
<rdfs:comment>Known for its innovative consumer electronics and software.</rdfs:comment>
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#iPad"/>
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#iPhone"/>
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#AppleWatch"/>
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#MacBook"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Audi">
|
||||
<ns1:produces rdf:resource="http://example.org/ontology#Audi_eTron"/>
|
||||
<ns1:produces rdf:resource="http://example.org/ontology#Audi_R8"/>
|
||||
<ns1:produces rdf:resource="http://example.org/ontology#Audi_A8"/>
|
||||
<rdf:type rdf:resource="http://example.org/ontology#CarManufacturer"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
<rdfs:comment>Known for its modern designs and technology.</rdfs:comment>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#AmazonEcho">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#HardwareCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Porsche_Taycan">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#ElectricCar"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#BMW">
|
||||
<ns1:produces rdf:resource="http://example.org/ontology#BMW_7Series"/>
|
||||
<ns1:produces rdf:resource="http://example.org/ontology#BMW_M4"/>
|
||||
<ns1:produces rdf:resource="http://example.org/ontology#BMW_iX"/>
|
||||
<rdf:type rdf:resource="http://example.org/ontology#CarManufacturer"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
<rdfs:comment>Focused on performance and driving pleasure.</rdfs:comment>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#VW_Touareg">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#SUV"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#SportsCar">
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
|
||||
<rdfs:subClassOf rdf:resource="http://example.org/ontology#Car"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#ElectricCar">
|
||||
<rdfs:subClassOf rdf:resource="http://example.org/ontology#Car"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Google">
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#GooglePixel"/>
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#GoogleCloud"/>
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#Android"/>
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#GoogleSearch"/>
|
||||
<rdf:type rdf:resource="http://example.org/ontology#TechnologyCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
<rdfs:comment>Started as a search engine and expanded into cloud computing and AI.</rdfs:comment>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#AmazonPrime">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#SoftwareCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Car">
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#WindowsOS">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#SoftwareCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Android">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#SoftwareCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Oculus">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#HardwareCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#GoogleCloud">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#CloudServiceProvider"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Microsoft">
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#Surface"/>
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#WindowsOS"/>
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#Azure"/>
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#Xbox"/>
|
||||
<rdf:type rdf:resource="http://example.org/ontology#TechnologyCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
<rdfs:comment>Dominant in software, cloud computing, and gaming.</rdfs:comment>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#GoogleSearch">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#SoftwareCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Mercedes_SClass">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#LuxuryCar"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Audi_A8">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#LuxuryCar"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Sedan">
|
||||
<rdfs:subClassOf rdf:resource="http://example.org/ontology#Car"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#VW_Golf">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#Sedan"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Facebook">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#SoftwareCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#WhatsApp">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#SoftwareCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#produces">
|
||||
<rdfs:domain rdf:resource="http://example.org/ontology#CarManufacturer"/>
|
||||
<rdfs:range rdf:resource="http://example.org/ontology#Car"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#BMW_7Series">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#LuxuryCar"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#BMW_M4">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#SportsCar"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Audi_eTron">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#ElectricCar"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Kindle">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#HardwareCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#BMW_iX">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#ElectricCar"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#SoftwareCompany">
|
||||
<rdfs:subClassOf rdf:resource="http://example.org/ontology#TechnologyCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Audi_R8">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#SportsCar"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Xbox">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#HardwareCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Technology">
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Mercedes_EQS">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#ElectricCar"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Porsche_911">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#SportsCar"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#HardwareCompany">
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
|
||||
<rdfs:subClassOf rdf:resource="http://example.org/ontology#TechnologyCompany"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#MercedesBenz">
|
||||
<ns1:produces rdf:resource="http://example.org/ontology#Mercedes_SClass"/>
|
||||
<ns1:produces rdf:resource="http://example.org/ontology#Mercedes_EQS"/>
|
||||
<ns1:produces rdf:resource="http://example.org/ontology#Mercedes_AMG_GT"/>
|
||||
<rdfs:comment>Synonymous with luxury and quality.</rdfs:comment>
|
||||
<rdf:type rdf:resource="http://example.org/ontology#CarManufacturer"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Amazon">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#TechnologyCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#Kindle"/>
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#AmazonEcho"/>
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#AWS"/>
|
||||
<ns1:develops rdf:resource="http://example.org/ontology#AmazonPrime"/>
|
||||
<rdfs:comment>From e-commerce to cloud computing giant with AWS.</rdfs:comment>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Instagram">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#SoftwareCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#AWS">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#CloudServiceProvider"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#SUV">
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
|
||||
<rdfs:subClassOf rdf:resource="http://example.org/ontology#Car"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#VW_ID4">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#ElectricCar"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#CloudServiceProvider">
|
||||
<rdfs:subClassOf rdf:resource="http://example.org/ontology#TechnologyCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Surface">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#HardwareCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#iPad">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#HardwareCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#iPhone">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#HardwareCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Mercedes_AMG_GT">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#SportsCar"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#MacBook">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#HardwareCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#develops">
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
|
||||
<rdfs:range rdf:resource="http://example.org/ontology#Technology"/>
|
||||
<rdfs:domain rdf:resource="http://example.org/ontology#TechnologyCompany"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#LuxuryCar">
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
|
||||
<rdfs:subClassOf rdf:resource="http://example.org/ontology#Car"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#AppleWatch">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#HardwareCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Porsche_Cayenne">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#SUV"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#GooglePixel">
|
||||
<rdf:type rdf:resource="http://example.org/ontology#HardwareCompany"/>
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#Company">
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://example.org/ontology#CarManufacturer">
|
||||
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
|
||||
<rdfs:subClassOf rdf:resource="http://example.org/ontology#Company"/>
|
||||
</rdf:Description>
|
||||
</rdf:RDF>
|
||||
Reference in New Issue
Block a user