How to assign a subclass to a SIOC Forum in RDF?
I'm using rdflib
to store a new SIOC:Forum on a SOLID POD. https://www.w3.org/Submission/sioc-spec/#sec-modules-types states that a SIOC:Forum can have the subtype/subclass of ChatChannel. How do I model my turtle (.ttl) request to store this subclass?
@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix types: <http://rdfs.org/sioc/types> .
@base <${uri}> .
:forum
a sioc:Forum ;
sioc:has_host <https://banyan.msg> ;
sioc:has_owner <${owner}> ;
rdf:type types:ChatChannel ; # <- is this correct?
sioc:has_subscriber [
a sioc:User ;
sioc:account_of <${partner}>
] .
rdf turtle-rdf solid
add a comment |
I'm using rdflib
to store a new SIOC:Forum on a SOLID POD. https://www.w3.org/Submission/sioc-spec/#sec-modules-types states that a SIOC:Forum can have the subtype/subclass of ChatChannel. How do I model my turtle (.ttl) request to store this subclass?
@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix types: <http://rdfs.org/sioc/types> .
@base <${uri}> .
:forum
a sioc:Forum ;
sioc:has_host <https://banyan.msg> ;
sioc:has_owner <${owner}> ;
rdf:type types:ChatChannel ; # <- is this correct?
sioc:has_subscriber [
a sioc:User ;
sioc:account_of <${partner}>
] .
rdf turtle-rdf solid
add a comment |
I'm using rdflib
to store a new SIOC:Forum on a SOLID POD. https://www.w3.org/Submission/sioc-spec/#sec-modules-types states that a SIOC:Forum can have the subtype/subclass of ChatChannel. How do I model my turtle (.ttl) request to store this subclass?
@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix types: <http://rdfs.org/sioc/types> .
@base <${uri}> .
:forum
a sioc:Forum ;
sioc:has_host <https://banyan.msg> ;
sioc:has_owner <${owner}> ;
rdf:type types:ChatChannel ; # <- is this correct?
sioc:has_subscriber [
a sioc:User ;
sioc:account_of <${partner}>
] .
rdf turtle-rdf solid
I'm using rdflib
to store a new SIOC:Forum on a SOLID POD. https://www.w3.org/Submission/sioc-spec/#sec-modules-types states that a SIOC:Forum can have the subtype/subclass of ChatChannel. How do I model my turtle (.ttl) request to store this subclass?
@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix types: <http://rdfs.org/sioc/types> .
@base <${uri}> .
:forum
a sioc:Forum ;
sioc:has_host <https://banyan.msg> ;
sioc:has_owner <${owner}> ;
rdf:type types:ChatChannel ; # <- is this correct?
sioc:has_subscriber [
a sioc:User ;
sioc:account_of <${partner}>
] .
rdf turtle-rdf solid
rdf turtle-rdf solid
asked Nov 13 '18 at 8:27
phippuphippu
4952620
4952620
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Summary
My first guess is that you are missing the #
at the end of the types
prefix declaration. Should be @prefix types: <http://rdfs.org/sioc/types#> .
Another observation, thanks to @timbl, is that you can simplify this by just listing the multiple types on the one a
line and removing rdf
prefix and usage altogether:
a sioc:Forum, types:ChatChannel ;
Details
Using the #
The prefixes get swapped in directly for their corresponding prefix:
usages in the rest of the turtle document. This means your reference to types:ChatChannel
would get translated to http://rdfs.org/sioc/typesChatChannel
, which is clearly not what you want.
Do note that you may not always need the #
. It depends on the namespace. In this case you're trying to reference a particular thing embedded in a larger document, so you use the url segment to achieve that. Some namespaces, like schema.org, assign different url paths to each thing. In that case the prefix would have to end in a /
.
Using the a
It's not at all obvious if you don't already know, but the a
keyword in turtle is an alias for the same rdf:type
predicate. See this one sentence in the w3 turtle docs. And, given that it's turtle, you can always pass a list of objects after the predicate by using a comma.
a
is an alias forrdf:type
(i. e.<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
) and not for<http://rdfs.org/sioc/types#>
– Stanislav Kralin
Nov 20 '18 at 10:40
Thanks @Stanislav, my bad.
– Jordan Shurmer
Nov 20 '18 at 11:03
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53276743%2fhow-to-assign-a-subclass-to-a-sioc-forum-in-rdf%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Summary
My first guess is that you are missing the #
at the end of the types
prefix declaration. Should be @prefix types: <http://rdfs.org/sioc/types#> .
Another observation, thanks to @timbl, is that you can simplify this by just listing the multiple types on the one a
line and removing rdf
prefix and usage altogether:
a sioc:Forum, types:ChatChannel ;
Details
Using the #
The prefixes get swapped in directly for their corresponding prefix:
usages in the rest of the turtle document. This means your reference to types:ChatChannel
would get translated to http://rdfs.org/sioc/typesChatChannel
, which is clearly not what you want.
Do note that you may not always need the #
. It depends on the namespace. In this case you're trying to reference a particular thing embedded in a larger document, so you use the url segment to achieve that. Some namespaces, like schema.org, assign different url paths to each thing. In that case the prefix would have to end in a /
.
Using the a
It's not at all obvious if you don't already know, but the a
keyword in turtle is an alias for the same rdf:type
predicate. See this one sentence in the w3 turtle docs. And, given that it's turtle, you can always pass a list of objects after the predicate by using a comma.
a
is an alias forrdf:type
(i. e.<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
) and not for<http://rdfs.org/sioc/types#>
– Stanislav Kralin
Nov 20 '18 at 10:40
Thanks @Stanislav, my bad.
– Jordan Shurmer
Nov 20 '18 at 11:03
add a comment |
Summary
My first guess is that you are missing the #
at the end of the types
prefix declaration. Should be @prefix types: <http://rdfs.org/sioc/types#> .
Another observation, thanks to @timbl, is that you can simplify this by just listing the multiple types on the one a
line and removing rdf
prefix and usage altogether:
a sioc:Forum, types:ChatChannel ;
Details
Using the #
The prefixes get swapped in directly for their corresponding prefix:
usages in the rest of the turtle document. This means your reference to types:ChatChannel
would get translated to http://rdfs.org/sioc/typesChatChannel
, which is clearly not what you want.
Do note that you may not always need the #
. It depends on the namespace. In this case you're trying to reference a particular thing embedded in a larger document, so you use the url segment to achieve that. Some namespaces, like schema.org, assign different url paths to each thing. In that case the prefix would have to end in a /
.
Using the a
It's not at all obvious if you don't already know, but the a
keyword in turtle is an alias for the same rdf:type
predicate. See this one sentence in the w3 turtle docs. And, given that it's turtle, you can always pass a list of objects after the predicate by using a comma.
a
is an alias forrdf:type
(i. e.<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
) and not for<http://rdfs.org/sioc/types#>
– Stanislav Kralin
Nov 20 '18 at 10:40
Thanks @Stanislav, my bad.
– Jordan Shurmer
Nov 20 '18 at 11:03
add a comment |
Summary
My first guess is that you are missing the #
at the end of the types
prefix declaration. Should be @prefix types: <http://rdfs.org/sioc/types#> .
Another observation, thanks to @timbl, is that you can simplify this by just listing the multiple types on the one a
line and removing rdf
prefix and usage altogether:
a sioc:Forum, types:ChatChannel ;
Details
Using the #
The prefixes get swapped in directly for their corresponding prefix:
usages in the rest of the turtle document. This means your reference to types:ChatChannel
would get translated to http://rdfs.org/sioc/typesChatChannel
, which is clearly not what you want.
Do note that you may not always need the #
. It depends on the namespace. In this case you're trying to reference a particular thing embedded in a larger document, so you use the url segment to achieve that. Some namespaces, like schema.org, assign different url paths to each thing. In that case the prefix would have to end in a /
.
Using the a
It's not at all obvious if you don't already know, but the a
keyword in turtle is an alias for the same rdf:type
predicate. See this one sentence in the w3 turtle docs. And, given that it's turtle, you can always pass a list of objects after the predicate by using a comma.
Summary
My first guess is that you are missing the #
at the end of the types
prefix declaration. Should be @prefix types: <http://rdfs.org/sioc/types#> .
Another observation, thanks to @timbl, is that you can simplify this by just listing the multiple types on the one a
line and removing rdf
prefix and usage altogether:
a sioc:Forum, types:ChatChannel ;
Details
Using the #
The prefixes get swapped in directly for their corresponding prefix:
usages in the rest of the turtle document. This means your reference to types:ChatChannel
would get translated to http://rdfs.org/sioc/typesChatChannel
, which is clearly not what you want.
Do note that you may not always need the #
. It depends on the namespace. In this case you're trying to reference a particular thing embedded in a larger document, so you use the url segment to achieve that. Some namespaces, like schema.org, assign different url paths to each thing. In that case the prefix would have to end in a /
.
Using the a
It's not at all obvious if you don't already know, but the a
keyword in turtle is an alias for the same rdf:type
predicate. See this one sentence in the w3 turtle docs. And, given that it's turtle, you can always pass a list of objects after the predicate by using a comma.
edited Nov 20 '18 at 11:03
answered Nov 13 '18 at 8:58
Jordan ShurmerJordan Shurmer
551314
551314
a
is an alias forrdf:type
(i. e.<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
) and not for<http://rdfs.org/sioc/types#>
– Stanislav Kralin
Nov 20 '18 at 10:40
Thanks @Stanislav, my bad.
– Jordan Shurmer
Nov 20 '18 at 11:03
add a comment |
a
is an alias forrdf:type
(i. e.<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
) and not for<http://rdfs.org/sioc/types#>
– Stanislav Kralin
Nov 20 '18 at 10:40
Thanks @Stanislav, my bad.
– Jordan Shurmer
Nov 20 '18 at 11:03
a
is an alias for rdf:type
(i. e. <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
) and not for <http://rdfs.org/sioc/types#>
– Stanislav Kralin
Nov 20 '18 at 10:40
a
is an alias for rdf:type
(i. e. <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
) and not for <http://rdfs.org/sioc/types#>
– Stanislav Kralin
Nov 20 '18 at 10:40
Thanks @Stanislav, my bad.
– Jordan Shurmer
Nov 20 '18 at 11:03
Thanks @Stanislav, my bad.
– Jordan Shurmer
Nov 20 '18 at 11:03
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53276743%2fhow-to-assign-a-subclass-to-a-sioc-forum-in-rdf%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown