This document explains how Schema Resume integrates with JSON-LD (JSON for Linking Data) and the Semantic Web.

🌐 What is JSON-LD?

JSON-LD is a method of encoding Linked Data using JSON. It allows your resume data to be:

  • Machine-readable by semantic web applications
  • Interoperable with other systems using Schema.org vocabulary
  • Discoverable by search engines and knowledge graphs
  • Portable across different platforms

⚠️ Important: @type for Schema.org Validation

When validating with validator.schema.org, you must include @type properties for all structured entities. The @type field specifies what kind of Schema.org entity each object represents.

Required @type Values

Resume SectionRequired @type
basicsschema:Person
basics.locationschema:PostalAddress
basics.profiles[]schema:ContactPoint
work[]schema:Organization
work[].locationschema:PostalAddress
volunteer[]schema:Organization
education[]schema:EducationalOrganization
certificates[]schema:EducationalOccupationalCredential
publications[]schema:Article
skills[]schema:DefinedTerm
tools[]schema:SoftwareApplication
projects[]schema:SoftwareApplication or schema:Event
references[]schema:Review

See SCHEMA-ORG-VALIDATION for complete details.

📋 Schema.org Mapping

Schema Resume maps resume fields to Schema.org vocabulary:

Resume FieldSchema.org PropertyType
nameschema:namePerson name
emailschema:emailEmail address
phoneschema:telephonePhone number
urlschema:urlPersonal website
labelschema:jobTitleJob title
summaryschema:descriptionDescription
locationschema:addressPostal address
industryschema:industryIndustry sector
contactDetailsschema:contactPointContact information
faxschema:faxNumberFax number
workschema:worksForWork experience
educationschema:alumniOfEducational background
skillsschema:knowsAboutSkills and knowledge
toolsschema:knowsAboutTools and software proficiency
languagesschema:knowsLanguageLanguage proficiency
awardsschema:awardAwards received
publicationsschema:publishedByPublished works
nationalitiesschema:nationalityCitizenship information
workAuthorizationschema:hasCredentialWork authorization and visas

🔗 Using the JSON-LD Context

Basic Usage

Include the @context field in your resume JSON:

{
  "@context": "https://tradik.github.io/schema-resume/schema.json",
  "$schema": "https://tradik.github.io/schema-resume/schema.json",
  "basics": {
    "@type": "schema:Person",
    "name": "John Doe",
    "email": "john@example.com",
    "location": {
      "@type": "schema:PostalAddress",
      "city": "San Francisco",
      "countryCode": "US"
    }
  }
}

Separate Context File

You can also reference the standalone context file:

{
  "@context": "https://tradik.github.io/schema-resume/context.jsonld",
  "basics": {
    "@type": "schema:Person",
    "name": "John Doe",
    "email": "john@example.com"
  }
}

🛠️ Processing JSON-LD

Using JSON-LD Playground

Test your resume in the JSON-LD Playground:

  1. Paste your resume JSON
  2. Click "Visualized" tab to see the graph
  3. Click "N-Quads" to see RDF triples

Using Python

from pyld import jsonld
import json
import requests

# Load your resume
with open('resume.json') as f:
    resume = json.load(f)

# Expand the JSON-LD
expanded = jsonld.expand(resume)
print(json.dumps(expanded, indent=2))

# Convert to RDF N-Quads
nquads = jsonld.to_rdf(resume, {'format': 'application/n-quads'})
print(nquads)

# Compact using a different context
context_url = "https://tradik.github.io/schema-resume/context.jsonld"
context = requests.get(context_url).json()
compacted = jsonld.compact(resume, context)
print(json.dumps(compacted, indent=2))

Using JavaScript

const jsonld = require('jsonld');
const fs = require('fs');

// Load your resume
const resume = JSON.parse(fs.readFileSync('resume.json', 'utf8'));

// Expand the JSON-LD
jsonld.expand(resume).then(expanded => {
  console.log(JSON.stringify(expanded, null, 2));
});

// Convert to RDF
jsonld.toRDF(resume, {format: 'application/n-quads'}).then(nquads => {
  console.log(nquads);
});

// Compact with context
const contextUrl = 'https://tradik.github.io/schema-resume/context.jsonld';
jsonld.compact(resume, contextUrl).then(compacted => {
  console.log(JSON.stringify(compacted, null, 2));
});

🔍 Querying with SPARQL

Once converted to RDF, you can query your resume using SPARQL:

PREFIX schema: <http://schema.org/>
PREFIX resume: <https://tradik.github.io/schema-resume/>

SELECT ?name ?email ?jobTitle
WHERE {
  ?person a schema:Person ;
          schema:name ?name ;
          schema:email ?email ;
          schema:jobTitle ?jobTitle .
}

🌟 Benefits of JSON-LD Integration

1. Search Engine Optimization (SEO)

Search engines like Google can understand structured data:

<script type="application/ld+json">
{
  "@context": "https://tradik.github.io/schema-resume/schema.json",
  "basics": {
    "@type": "schema:Person",
    "name": "John Doe",
    "jobTitle": "Software Engineer",
    "url": "https://johndoe.dev"
  }
}
</script>

2. Knowledge Graph Integration

Your resume can be integrated into knowledge graphs:

  • Company HR systems
  • Professional networks
  • Academic databases
  • Research platforms

3. Data Portability

Easy conversion between formats:

  • JSON-LD → RDF/XML
  • JSON-LD → Turtle
  • JSON-LD → N-Triples
  • JSON-LD → N-Quads

4. Semantic Queries

Query across multiple resumes:

# Find all people who know Python
SELECT ?name ?skill
WHERE {
  ?person schema:name ?name ;
          schema:knowsAbout ?skill .
  FILTER(CONTAINS(LCASE(?skill), "python"))
}

📊 Example: Expanded JSON-LD

Original:

{
  "@context": "https://tradik.github.io/schema-resume/schema.json",
  "basics": {
    "@type": "schema:Person",
    "name": "John Doe",
    "email": "john@example.com"
  }
}

Expanded (RDF):

[
  {
    "http://schema.org/name": [
      {
        "@value": "John Doe"
      }
    ],
    "http://schema.org/email": [
      {
        "@value": "john@example.com"
      }
    ]
  }
]

🔧 Custom Context

You can extend the context for custom fields:

{
  "@context": [
    "https://tradik.github.io/schema-resume/context.jsonld",
    {
      "customField": "https://example.com/vocab#customField"
    }
  ],
  "basics": {
    "@type": "schema:Person",
    "name": "John Doe",
    "customField": "Custom value"
  }
}

🎯 Use Cases

1. Resume Aggregation

Aggregate resumes from multiple sources:

import rdflib

g = rdflib.Graph()

# Load multiple resumes
g.parse('resume1.json', format='json-ld')
g.parse('resume2.json', format='json-ld')
g.parse('resume3.json', format='json-ld')

# Query all names
query = """
    PREFIX schema: <http://schema.org/>
    SELECT ?name WHERE {
        ?person schema:name ?name .
    }
"""
for row in g.query(query):
    print(row.name)

2. Skill Matching

Match candidates to job requirements:

PREFIX schema: <http://schema.org/>

SELECT ?person ?name (COUNT(?skill) as ?matchCount)
WHERE {
  ?person schema:name ?name ;
          schema:knowsAbout ?skill .
  VALUES ?requiredSkill { "Python" "JavaScript" "Docker" }
  FILTER(?skill = ?requiredSkill)
}
GROUP BY ?person ?name
ORDER BY DESC(?matchCount)

3. Network Analysis

Build professional networks:

PREFIX schema: <http://schema.org/>

SELECT ?person1 ?person2
WHERE {
  ?person1 schema:worksFor ?org .
  ?person2 schema:worksFor ?org .
  FILTER(?person1 != ?person2)
}

📚 Resources

Tools

Libraries

JavaScript:

Python:

PHP:

Java:

Validators

🔐 Privacy Considerations

When using JSON-LD:

  • Be aware that data becomes more discoverable
  • Consider what information to make public
  • Use appropriate access controls
  • Follow GDPR and privacy regulations
  • Provide clear consent mechanisms

🚀 Next Steps

  1. Test your resume in the JSON-LD Playground
  2. Validate with Schema.org validator
  3. Convert to RDF for graph databases
  4. Query with SPARQL for advanced analytics
  5. Integrate with semantic web applications

💡 Tips

  • Always include @context for JSON-LD compatibility
  • Include @type for Schema.org validation - Required by validator.schema.org
  • Use Schema.org vocabulary when possible
  • Test with multiple JSON-LD processors
  • Validate your data regularly
  • Keep context files versioned
  • Document custom extensions
  • See SCHEMA-ORG-VALIDATION for @type requirements

For more information, see:

Edit this page on GitHub