XML to RDF Converter
Transform XML data into RDF format for semantic web and linked data applications
XML Input
RDF Output
About XML to RDF Converter
Convert XML data to RDF (Resource Description Framework) format for semantic web applications, knowledge graphs, and linked data. Supports multiple RDF serialization formats.
Key Features
- Multiple RDF Formats: Turtle (.ttl), RDF/XML (.rdf), N-Triples (.nt)
- Automatic Type Detection: Recognizes numeric values and URIs
- Custom Base URI: Configure resource URI namespace
- Property Sanitization: Converts XML tags to valid RDF property names
- W3C Compliant: Follows RDF standards and best practices
- File Upload: Upload .xml files directly
- Copy & Download: Easy export in chosen RDF format
How to Use
- Input XML Data: Paste your XML data or upload an .xml file
- Select RDF Format: Choose between Turtle, RDF/XML, or N-Triples
- Configure Base URI: Set the namespace for your resources (optional)
- Review Output: The RDF data generates automatically
- Copy or Download: Use the Copy or Download button to save your RDF file
RDF Format Options
- Turtle (.ttl): Human-readable, compact syntax with prefixes
- RDF/XML (.rdf): XML-based format, widely supported
- N-Triples (.nt): Simple line-based format, easy to parse
Supported XML Structures
The converter recognizes several common XML table patterns:
- <table><row>...</row></table>: Standard table structure
- <data><record>...</record></data>: Data records pattern
- <records><record>...</record></records>: Records collection
- Repeated Elements: Any root with repeated child elements
- Attributes: Also supports attribute-based data
Type Detection
The converter automatically detects data types:
- URIs: Values starting with http:// or https:// become resource references
- Numeric: Integer and decimal values get xsd:decimal datatype
- String: All other values are treated as literal strings
Example Conversion
XML Input:
<?xml version="1.0" encoding="UTF-8"?>
<data>
<record>
<Name>John Doe</Name>
<Age>28</Age>
<City>New York</City>
</record>
<record>
<Name>Jane Smith</Name>
<Age>34</Age>
<City>London</City>
</record>
</data> Turtle Output:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <http://example.org/vocab/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . <http://example.org/data/record1> ex:name "John Doe" ; ex:age "28"^^xsd:decimal ; ex:city "New York" . <http://example.org/data/record2> ex:name "Jane Smith" ; ex:age "34"^^xsd:decimal ; ex:city "London" .
Common Use Cases
- Semantic Web: Create linked data for web applications
- Knowledge Graphs: Build structured knowledge representations
- Triple Stores: Import data into RDF databases (Virtuoso, Jena, etc.)
- SPARQL Queries: Enable semantic queries on your data
- Linked Open Data: Publish data in standard RDF formats
- Ontology Development: Create instance data for ontologies
RDF Benefits
- Interoperable: Standard format for data exchange
- Extensible: Easy to add new properties and relationships
- Queryable: Use SPARQL for complex queries
- Linked: Connect data across different sources
- Semantic: Machine-readable meaning and relationships
- Standards-Based: W3C recommendations ensure compatibility
Property Name Sanitization
XML tags are automatically converted to valid RDF property names:
- Converts to lowercase with underscores
- Removes special characters
- Ensures names start with letters or underscores
- Handles duplicate names appropriately
Privacy & Security
All conversions happen locally in your browser. Your XML data is never uploaded to any server, ensuring complete privacy and security.
