agentleFS
OpenLinkSoftwareOpenLinkSoftware/ai-agent-skills/infographic-describer/SKILL.md

infographic-describer

Skill42 starsChanged 50 days agoMITView on GitHub

Generate RDF-Turtle descriptions (schema:ImageObject, schema:VideoObject, schema:WebPage) for infographic files in a WebDAV directory, using SHACL shapes as the property contract. Trigger when: user asks to describe infographics, generate metadata for a DAV directory, create RDF descriptions for image/video collections, or apply a SHACL shape to bulk-describe files. Handles content negotiation (HTML describe pages vs SPARQL DESCRIBE), filename-derived metadata, thumbnail URL detection, and category inference.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 4 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check which files have existing RDF data in the triplestore.

    line 30
  2. Distinctive:

    Check for thumbnails using the content-explorer pattern:

    line 47
  3. Very specific:

    Only files with 200 have thumbnails.

    line 59
  4. Distinctive:

    Use this template structure:

    line 94
  5. Very specific:

    Add schema:thumbnailUrl only if the probe returned 200.

    line 112
  6. Distinctive:

    When generating or updating SHACL shapes to match describe output:

    line 133
  7. Very specific:

    Use sh:minCount 0 for properties that may not exist for all files (thumbnailUrl, dateCreated, dateModified)

    line 135
  8. Very specific:

    Use sh:minCount 1 for always-present properties (name, contentUrl, encodingFormat, type)

    line 136
  9. Very specific:

    Use sh:hasValue for fixed values (e.g., encodingFormat = "image/png")

    line 137
  10. Very specific:

    Use sh:targetClass to match the schema type

    line 138

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Infographic Describer

Generate RDF-Turtle descriptions for files in a WebDAV-hosted directory using a SHACL shape as the property contract.

Workflow

Step 1: Discover Files

List the target WebDAV directory to enumerate files:

curl -sL "https://www.openlinksw.com/data/{directory}/" | python3 -c "
import sys, re
html = sys.stdin.read()
files = re.findall(r'title=\"File - ([^\"]+)\"', html)
for f in files:
    print(f)
"

Classify by extension: .png → schema:ImageObject, .mp4 → schema:VideoObject, .html → schema:WebPage.

Step 2: Probe Describe Endpoint

Check which files have existing RDF data in the triplestore. Use the SPARQL DESCRIBE endpoint:

import urllib.parse, urllib.request

iri = f'https://www.openlinksw.com/DAV/www2.openlinksw.com/data/{directory}/{stem}.{ext}'
query = f'DESCRIBE <{iri}>'
url = 'http://www.openlinksw.com/sparql?query=' + urllib.parse.quote(query) + '&output=text%2Fn3'

req = urllib.request.Request(url, headers={'Accept': 'text/n3, */*'})
resp = urllib.request.urlopen(req, timeout=30)
data = resp.read().decode()
has_data = 'Empty' not in data and len(data.strip()) > 50

Step 3: Probe Thumbnails

Check for thumbnails using the content-explorer pattern:

https://www.openlinksw.com/data/content-explorer/thumbnails/{category}-{stem}.avif

Where {category} is the directory name (e.g., infographics). Probe with HTTP HEAD:

curl -sL -o /dev/null -w "%{http_code}" "$url"

Only files with 200 have thumbnails.

Step 4: Generate Descriptions

For each file, construct RDF triples using the SHACL shape properties:

PropertySourceFallback
rdf:typeFile extensionschema:CreativeWork
schema:nameFilename stem (underscores/hyphens → spaces)—
schema:descriptionDerived from name or describe page"Infographic: {name}"
schema:encodingFormatContent type from listingMap extension to MIME
schema:contentUrlFull DAV URL—
schema:thumbnailUrlProbe result (only if 200)Omit
schema:categoryDirectory-based category IRIDefault to #Infographic
wdrs:describedbyConstructed describe endpoint URL—
schema:dateCreatedDescribe page (if available)Omit
schema:dateModifiedDescribe page (if available)Omit

Entity IRI pattern: {contentUrl}#this

Category IRIs (content-explorer-metadata.ttl):

  • #Infographic — default for /data/infographics/
  • #Guide — filenames containing "guide"
  • #Demo — filenames containing "demo"
  • #Survey — filenames containing "survey"

Encoding format mapping:

  • .png → image/png
  • .jpg/.jpeg → image/jpeg
  • .mp4 → video/mp4
  • .html → text/html

Step 5: Generate Turtle

Use this template structure:

@prefix schema: <http://schema.org/> .
@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix wdrs:   <http://www.w3.org/2007/05/powder-s#> .
@prefix xsd:    <http://www.w3.org/2001/XMLSchema#> .

<{contentUrl}#this>
    a {schemaType} ;
    schema:name "{name}" ;
    schema:description "{description}" ;
    schema:encodingFormat "{mimeType}" ;
    schema:contentUrl <{contentUrl}> ;
    schema:category <{categoryIri}> ;
    wdrs:describedby <{describeUrl}> .

Add schema:thumbnailUrl only if the probe returned 200.

Step 6: Validate

Validate the generated Turtle:

from rdflib import Graph
g = Graph()
g.parse('output.ttl', format='turtle')
print(f'{len(g)} triples, {len(set(g.subjects()))} entities')

Step 7: Save

Save to the user-designated output path. Default:

  • Shapes: /Users/kidehen/Documents/RDF_DATA/shacl-shapes/
  • Descriptions: same directory as the shapes

SHACL Shape Conventions

When generating or updating SHACL shapes to match describe output:

  • Use sh:minCount 0 for properties that may not exist for all files (thumbnailUrl, dateCreated, dateModified)
  • Use sh:minCount 1 for always-present properties (name, contentUrl, encodingFormat, type)
  • Use sh:hasValue for fixed values (e.g., encodingFormat = "image/png")
  • Use sh:targetClass to match the schema type

Notes

  • The /describe endpoint requires a POST with h=1 to bypass the confirmation dialog
  • Most files in a DAV directory will have sparse or no RDF data — filename-derived metadata is the norm
  • Thumbnails are rare — only files processed by the content-explorer system have them
  • The SPARQL DESCRIBE endpoint (without CBD mode) returns more data than CBD mode for these resources

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.