Comments (2)
Sorry for the slow response, extremely busy around here. Thanks for the bug report, we will look into this when we can.
from pyld.
When running this:
import json
from pyld import jsonld
doc = {
"@context": {
"dbpedia": "http://dbpedia.org/ontology/",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"owl": "http://www.w3.org/2002/07/owl#",
"@base": "http://myurl.com/astronomy",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"skos": "http://www.w3.org/2004/02/skos/core#",
"schema": "https://schema.org/",
"defines": {"@reverse": "rdfs:isDefinedBy"}
},
"@id": "",
"@type": ["http://www.w3.org/2002/07/owl#Ontology"],
"defines" : [{"@id": "http://example.com"}]
}
result = jsonld.expand(doc);
print(json.dumps(result, indent=2))
It produces:
[
{
"@reverse": {
"http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [
{
"@id": "http://example.com"
}
]
},
"@id": "http://myurl.com/astronomy",
"@type": [
"http://www.w3.org/2002/07/owl#Ontology"
]
}
]
If I change it to run compaction over the document with the same context:
result = jsonld.compact(doc, doc['@context']);
print(json.dumps(result, indent=2))
I get this:
{
"@context": {
"owl": "http://www.w3.org/2002/07/owl#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"@base": "http://myurl.com/astronomy",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"dbpedia": "http://dbpedia.org/ontology/",
"schema": "https://schema.org/",
"skos": "http://www.w3.org/2004/02/skos/core#",
"defines": {
"@reverse": "rdfs:isDefinedBy"
}
},
"@id": "astronomy",
"@type": "owl:Ontology",
"defines": {
"@id": "http://example.com"
}
}
What code are you running that is dropping the defines
property? Are you including the context in the input?
from pyld.
Related Issues (20)
- @requireAll does not work with @type
- Clarify support for interpreting-json-as-json-ld
- blank node prefixes are not handled correctly
- Compact a framed JSON-LD document? HOT 1
- `JsonLdProcessor._compare_rdf_triples()` is a massive performance hog in `parse_nquads`
- implement JSON-LD-star
- ping HOT 4
- aliasing @id not working
- jsonld.to_rdf: Zeros not truncated for numeric values with negative exponent
- number with 0 fractional part should parse to an xsd:integer
- Performance issues with jsonld.normalize
- `jsonld.expand` incorrect when there are identical scoped contexts HOT 1
- Include JSON-LD specifications as `git` submodules HOT 2
- compaction with URL context doesn't work
- Implement custom document loader option HOT 1
- IRI expansion with missing `@base` does not conform to RFC 3986 HOT 1
- [BUG] Framing a document with the traceability context raises an error HOT 1
- Switch from `normalization` to `rdf-canon` test suite
- Use `Makefile` to improve developer experience
- Language tagged strings HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyld.