XooCode(){

SoftwareSourceCode

SoftwareSourceCode is a CreativeWork subtype for source code: GitHub repositories, code snippets, scripts, templates, and code samples. It has 5 properties of its own: codeRepository (link to the repo), programmingLanguage, codeSampleType (full solution, snippet, or template), runtimePlatform (dependencies), and targetProduct (the software it builds). Google reads this for code-related searches and may show repository information in search results.

The type hierarchy is Thing → CreativeWork → SoftwareSourceCode. Use it on repository landing pages, code sample pages, and documentation sites that host downloadable code. It complements SoftwareApplication: the application is the compiled product, the source code is the human-readable code behind it.

Full example of schema.org/SoftwareSourceCode json-ld markup

The markup is verified as valid with Rich Results Test from Google.

Highlight legend:Required by GoogleRecommendedOptional
schema.org/SoftwareSourceCode
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "SoftwareSourceCode",
  "name": "xoostructured-validator",
  "description": "Open-source JSON-LD validator for schema.org types. Validates @context, @type, property values, enum correctness, and URL formats.",
  "codeRepository": "https://github.com/xoocode/xoostructured-validator",
  "programmingLanguage": "TypeScript",
  "codeSampleType": "full",
  "runtimePlatform": "Node.js 18+",
  "targetProduct": {
    "@type": "SoftwareApplication",
    "name": "XooStructured IDE",
    "@id": "https://xoocode.com/products/xoostructured-ide/v3#model"
  },
  "author": { "@id": "https://xoocode.com#organization" },
  "license": "https://opensource.org/licenses/MIT",
  "datePublished": "2025-03-01",
  "url": "https://github.com/xoocode/xoostructured-validator"
}
</script>

codeRepository

codeRepository is the URL of the repository: a GitHub URL, GitLab URL, or any version control hosting. This is the primary link Google uses to connect the code to a specific repository.

programmingLanguage

programmingLanguage takes a text string or ComputerLanguage object: "TypeScript", "Python", "Rust". Google uses this for language-filtered code searches. Use the common name of the language.

Minimal valid version

The smallest markup that still produces a valid SoftwareSourceCode entity. Use it as the floor. Reach for the advanced example above when you want search engines and AI agents to understand more about your content.

schema.org/SoftwareSourceCode (minimal)
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "SoftwareSourceCode",
  "name": "xoostructured-validator",
  "codeRepository": "https://github.com/xoocode/xoostructured-validator",
  "programmingLanguage": "TypeScript",
  "description": "Open-source JSON-LD validator for schema.org types."
}
</script>

Google rich results this unlocks

Markup matching this example makes your page eligible for the following Google Search rich results. The primary target drives the required / recommended property classification in the advanced code block above.

Common SoftwareSourceCode mistakes

Mistakes that pass validation but silently fail to earn rich results or mislead consumers walking the graph. Avoid these and your markup will be ahead of most sites in the wild.

  1. 01

    Using SoftwareApplication for source code

    Wrong
    "@type": "SoftwareApplication" for a GitHub repository
    Right
    "@type": "SoftwareSourceCode" for repos; SoftwareApplication for installable apps

    SoftwareSourceCode is the code. SoftwareApplication is the compiled/installable product. A GitHub repo is SoftwareSourceCode. A downloadable app or SaaS product is SoftwareApplication. They can reference each other via targetProduct.

  2. 02

    Missing codeRepository

    Wrong
    SoftwareSourceCode with name and language but no codeRepository
    Right
    "codeRepository": "https://github.com/xoocode/xoostructured-validator"

    codeRepository is the primary property. Without it, there is no link to the actual code. This is the property that distinguishes SoftwareSourceCode from a generic CreativeWork about programming.

About the example data

The open-source validator module from the XooStructured IDE, hosted on GitHub. Written in TypeScript, it validates JSON-LD against schema.org types.

Comments

Loading comments...

Leave a comment