{"id":24746525,"url":"https://github.com/anjola-adeuyi/bulbapedia-knowledge-graph","last_synced_at":"2026-05-17T03:45:37.065Z","repository":{"id":272672165,"uuid":"917381580","full_name":"anjola-adeuyi/bulbapedia-knowledge-graph","owner":"anjola-adeuyi","description":"A Semantic Web application that builds a Knowledge Graph (KG) from Bulbapedia, similar to how DBpedia was built from Wikipedia. This project captures Pokémon data from Bulbapedia, converts it into RDF format, and provides various interfaces to access and query the knowledge graph.","archived":false,"fork":false,"pushed_at":"2025-01-16T22:49:00.000Z","size":1760,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-28T04:31:18.678Z","etag":null,"topics":["bulbapedia","bulbapedia-parser","dbpedia","fuseki","knowledge-graph","pokedex","rdf","rdfs","shacl","shacl-shapes","sparql","triples","triplestore","wikidata"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anjola-adeuyi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-15T21:50:55.000Z","updated_at":"2025-01-17T00:20:46.000Z","dependencies_parsed_at":"2025-01-16T00:14:53.515Z","dependency_job_id":"26e1c4ec-83d4-4a16-8ecb-446ece2e55c5","html_url":"https://github.com/anjola-adeuyi/bulbapedia-knowledge-graph","commit_stats":null,"previous_names":["anjola-adeuyi/bulbapedia-knowledge-graph"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anjola-adeuyi%2Fbulbapedia-knowledge-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anjola-adeuyi%2Fbulbapedia-knowledge-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anjola-adeuyi%2Fbulbapedia-knowledge-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anjola-adeuyi%2Fbulbapedia-knowledge-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anjola-adeuyi","download_url":"https://codeload.github.com/anjola-adeuyi/bulbapedia-knowledge-graph/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245041853,"owners_count":20551473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bulbapedia","bulbapedia-parser","dbpedia","fuseki","knowledge-graph","pokedex","rdf","rdfs","shacl","shacl-shapes","sparql","triples","triplestore","wikidata"],"created_at":"2025-01-28T04:29:04.585Z","updated_at":"2025-10-30T14:16:46.272Z","avatar_url":"https://github.com/anjola-adeuyi.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bulbapedia Knowledge Graph\n\nA Semantic Web application that builds a Knowledge Graph (KG) from Bulbapedia, similar to how DBpedia was built from Wikipedia. This project captures Pokémon data from Bulbapedia, converts it into RDF format, and provides various interfaces to access and query the knowledge graph.\n\n## Features\n\n### 1. Knowledge Graph Generation\n\n- Extracts data from Bulbapedia's wiki pages using MediaWiki API\n- Converts wiki content into RDF triples with schema.org alignment\n- Implements proper ontology and vocabulary design\n- Maintains multilingual labels (English, Japanese, Romaji)\n- Includes entity linking to DBpedia and Wikidata\n- Supports multiple Pokemon generations\n- Processes evolution chains with type preservation\n\n### 2. Data Validation\n\n- SHACL shapes for validating the knowledge graph structure\n- Constraints on Pokémon properties (height, weight, types)\n- Type hierarchy validation\n- Property cardinality rules\n- RDF quality checks using Jena validation\n\n### 3. Query Interface\n\n- SPARQL endpoint (port 3330)\n- Support for inference in queries:\n  - RDFS subclass hierarchy\n  - Transitive properties (owl:sameAs)\n  - Property inheritance\n- Predefined useful queries for common operations\n\n### 4. Linked Data Interface\n\n- Content negotiation (HTML/RDF)\n- Human-readable HTML views with:\n  - Pokemon details\n  - Type information\n  - Evolution chains\n  - External links\n- Machine-readable RDF views (Turtle format)\n- Proper hyperlinking between resources\n\n## Prerequisites\n\n- Java 11 or higher\n- Maven\n- Git\n- Adequate disk space for the knowledge graph\n\n## Installation\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/anjola-adeuyi/bulbapedia-knowledge-graph.git\ncd bulbapedia-knowledge-graph\n```\n\n2. Build the project:\n\n```bash\nmvn clean install\n```\n\n## Running the Application\n\n1. Start the application:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"org.example.App\"\n```\n\nThis will start:\n\n- Fuseki SPARQL endpoint on port 3330\n- Linked Data interface on port 3331\n\n2. Verify the services are running:\n\n```bash\n# Test Fuseki\ncurl http://localhost:3330/pokemon/query\n\n# Test Linked Data interface\ncurl -H \"Accept: text/turtle\" http://localhost:3331/resource/0001\n```\n\n## Testing The Features\n\n## API Documentation\n\n### 1. SPARQL Endpoint (Port 3330)\n\n#### Using curl\n\n```bash\n# Example query to get all Pokémon names\ncurl -X POST \\\n  -H \"Content-Type: application/sparql-query\" \\\n  -d 'PREFIX schema: \u003chttp://schema.org/\u003e\n      SELECT ?name WHERE {\n        ?s schema:name ?name\n      }' \\\n  http://localhost:3330/pokemon/query\n```\n\n#### Using Postman\n\n1. Create a new POST request to `http://localhost:3330/pokemon/query`\n2. Set Content-Type header to `application/sparql-query`\n3. In the body, enter your SPARQL query\n4. Send the request\n\n#### Example Queries\n\n1. Get Pokémon and their types:\n\n```sparql\nPREFIX rdf: \u003chttp://www.w3.org/1999/02/22-rdf-syntax-ns#\u003e\nPREFIX pokemon: \u003chttp://example.org/pokemon/\u003e\nPREFIX schema: \u003chttp://schema.org/\u003e\n\nSELECT ?name ?primaryType ?secondaryType\nWHERE {\n  ?pokemon rdf:type pokemon:Pokemon ;\n           schema:name ?name ;\n           pokemon:primaryType ?primaryType .\n  OPTIONAL { ?pokemon pokemon:secondaryType ?secondaryType }\n}\nORDER BY ?name\n```\n\n2. Find evolution chains:\n\n```sparql\nPREFIX pokemon: \u003chttp://example.org/pokemon/\u003e\nPREFIX schema: \u003chttp://schema.org/\u003e\n\nSELECT ?baseName ?evolvedName ?commonType\nWHERE {\n  ?base schema:name ?baseName ;\n        pokemon:primaryType ?commonType .\n  ?evolved pokemon:evolvesFrom+ ?base ;\n           schema:name ?evolvedName ;\n           pokemon:primaryType ?commonType .\n}\nORDER BY ?baseName ?evolvedName\n```\n\n### 2. Linked Data Interface (Port 3331)\n\n#### Browser Access\n\n1. Visit `http://localhost:3331/resource/0001` for Bulbasaur\n2. Navigate through Pokémon using the evolution chain links\n\n#### Programmatic Access\n\n```bash\n# Get RDF data (Turtle format)\ncurl -H \"Accept: text/turtle\" http://localhost:3331/resource/0001\n\n# Get HTML representation\ncurl -H \"Accept: text/html\" http://localhost:3331/resource/0001\n```\n\n### 3. Validation\n\nThe application automatically validates all data against SHACL shapes. You can find the shapes in:\n\n- `pokemon-shapes.ttl`\n\nTo manually validate:\n\n1. Extract the shapes file\n2. Use a SHACL validator (like Apache Jena SHACL)\n3. Run validation against your RDF data\n\n## Project Structure\n\n```bash\nbulbapedia-knowledge-graph/\n├── src/\n│   └── main/\n│       ├── java/\n│       │   └── org/example/\n│       │       ├── App.java                    # Main application\n│       │       ├── client/                     # Wiki API client\n│       │       ├── inference/                  # RDF inference\n│       │       ├── linking/                    # Entity linking\n│       │       ├── parser/                     # Wiki parsing\n│       │       ├── rdf/                        # RDF conversion\n│       │       ├── server/                     # Web servers\n│       │       └── validation/                 # SHACL validation\n│       └── resources/\n│           ├── static/                         # Web interface\n│           ├── templates/                      # HTML templates\n│           └── queries/                        # SPARQL queries\n├── pokemon.ttl                                 # Generated KG\n├── pokemon-shapes.ttl                          # SHACL shapes\n└── pom.xml\n```\n\n### Components\n\n- **BulbapediaClient**: Handles API requests to Bulbapedia\n- **WikiInfoboxParser**: Extracts structured data from wiki pages\n- **PokemonRDFConverter**: Converts parsed data to RDF\n- **InferenceHandler**: Implements RDFS and OWL inference\n- **LinkedDataServer**: Provides web interface and content negotiation\n- **PokemonFusekiServer**: Manages SPARQL endpoint\n\n### Access the interfaces\n\n- SPARQL endpoint: http://localhost:3330/pokemon/query\n- Linked Data interface: http://localhost:3331/\n- Example Pokemon: http://localhost:3331/resource/0001\n\n### Validate RDF\n\n```java\nModel model = ModelFactory.createDefaultModel();\nmodel.read(\"pokemon.ttl\", \"TURTLE\");\nSystem.out.println(\"Valid RDF with \" + model.size() + \" triples\");\n```\n\n## Features Implementation\n\nThe project implements all required features from the course specification:\n\n1. Knowledge Graph Creation ✓\n\n   - Captures wiki content as RDF\n   - Converts infoboxes to triples\n   - Preserves wiki links as RDF relationships\n\n2. Multilingual Support ✓\n\n   - Labels in multiple languages\n   - Uses proper language tags\n   - Integrates Pokédex translations\n\n3. Schema Validation ✓\n\n   - SHACL shapes for validation\n   - Derived from wiki templates\n   - Consistent vocabulary usage\n\n4. External Linking ✓\n\n   - Links to DBpedia\n   - Links to Wikidata\n   - Preserves wiki page links\n\n5. SPARQL Access ✓\n\n   - Full SPARQL endpoint\n   - Support for complex queries\n   - Inference capabilities\n\n6. Linked Data Interface ✓\n   - Content negotiation\n   - HTML/RDF views\n   - Proper hyperlinking\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/new-feature`)\n3. Commit your changes (`git commit -m 'Add some new feature'`)\n4. Push to the branch (`git push origin feature/new-feature`)\n5. Open a Pull Request\n\n## Acknowledgments\n\n- Professor Antoine Zimmermann and Professor Victor Charpenay for the course structure and guidance\n- Bulbapedia community for maintaining the Pokémon wiki\n- DBpedia and YAGO project for inspiration\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanjola-adeuyi%2Fbulbapedia-knowledge-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanjola-adeuyi%2Fbulbapedia-knowledge-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanjola-adeuyi%2Fbulbapedia-knowledge-graph/lists"}