In the RDF Turtle documentation from W3C I came across two examples (16 and 17) where an email address was used as an IRI:
_:b <http://xmlns.com/foaf/0.1/mbox> <bob#example.com> .
As I understand it, email addresses are allowed as URIs when preceded with the appropriate scheme, i.e. mailto:bob#example.com. If the email address in the above example should be a valid URI then the statement should actually read:
_:b <http://xmlns.com/foaf/0.1/mbox> <mailto:bob#example.com> .
Is this an error in the documentation or do IRIs (as opposed to URIs) not require a scheme?
While I think it makes more sense to use something like mailto:bob#example.org in these examples, it appears that they're still syntactically legal. They're just resolved as relative URIs against the base. E.g., when I use Jena's rdfcat to convert from Turtle I get the following output in Turtle and RDF/XML.
#prefix : <urn:ex:> .
#base <http://example.org> .
:a :hasEmail <bob#example.org>.
Output in Turtle and RDF/XML:
#prefix : <urn:ex:> .
:a :hasEmail <http://example.org/bob#example.org> .
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="urn:ex:">
<rdf:Description rdf:about="urn:ex:a">
<hasEmail rdf:resource="http://example.org/bob#example.org"/>
</rdf:Description>
</rdf:RDF>
Related
The source code of UNIX V6 is available and there is a book on it by J.Lions. From the book I know that " . " symbol means current location. I do not understand the next:
"*An assignment statement of the form
identifier = expression
associates a value and type with the identifier. In the example
. = 60^.
the operator ’^’ delivers the value of the first
operand and the type of the second operand
(in this case, “location”);*"
The statement can be found in file low.s (0526). What does it mean? Does it actually change PC register value and behaves as a jump instruction? I know it is old code, but I want to understand it. Thank you.
In the 6th edition assembler, . is the location counter, an offset from the beginning of a segment (text, data, or bss). When the assembler starts processing a file, . in each segment is 0, and is incremented either by assignment to . or by the presence of data or instruction statements.
The statement . = 60^. means to take the value 60 (in octal), cast it to the type of the location counter (in this case, type data), and assign it to the location counter. You'll see several statements like this in low.s in the area where interrupt vectors are set up.
When the link editor combines multiple object files together, their text, data, and bss sections are concatenated (except for COMMON data, which gets allocated just once) and any references (such as labels) to instructions or data will be relocated appropriately.
Building the Unix kernel requires an extra step to make sure data meant to be in low memory get loaded at the proper address. After low.s and the rest of the Unix kernel object files have been linked together, sysfix is run to make the data section have a load address of 0, and to relocate all data references appropriately. So that . = 60^. statement has effectively set the location counter to physical address 60.
What can you do with Labeled Property Graph used by companies such as Neo4j that you can not do with RDF* /SPARQL* used by BlazeGraph?
What you can do with the store depends, of course, on the stores. And the capabilities of Neo4j and Blazegraph are very different.
Now, if your question is what can I express with RDF-star compared to what the property graph model can express, then this is a valid question, and the answer is they are pretty much equivalent in terms of expressivity.
The property graph uses a higher level of abstraction as its primitives are nodes and relationships, both of which can have internal structure (as in attributes describing them). Instead, RDF breaks every bit of information into triples/statements.
A simple graph describing me posting an answer in StackOverflow can be expressed in Cypher like this:
CREATE
(:Person { uri: 'http://me.com/jb', name: 'JB'})-[:POST { date:'20/06/2021'}]->(:Answer { uri: 'http://stackoverflow.com/answer/1234', text: 'blah blah blah...'})
...and exactly the same information in SPARQL + RDF-star would look like this:
INSERT DATA
{
<http://me.com/jb> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> .
<http://me.com/jb> <http://schema.org/name> "JB" .
<http://stackoverflow.com/answer/1234> <http://schema.org/text> "blah blah blah..." .
<http://me.com/jb> <http://schema.org/post> <http://stackoverflow.com/answer/1234> .
<http://stackoverflow.com/answer/1234> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Answer> .
<http://me.com/jb> <http://schema.org/post> <http://stackoverflow.com/answer/1234> .
<<<http://me.com/jb> <http://schema.org/post> <http://stackoverflow.com/answer/1234>>>
<http://schema.org/dateCreated> "20/06/2021" .
}
So you can express the same, but one is arguably more "data exchange oriented" (RDF), and the other is more "data manipulation / developer oriented".
When a line in my CSS file appears to be too long (typically a property followed by a bunch of values), I want to split them in to several new lines like this (sorry for my low reputation):
https://i.stack.imgur.com/bxXvv.png
But I have to manually enter spaces before the lines to achieve that. In reality, when I hit TAB with my cursor on the url line, what I get is this:
https://i.stack.imgur.com/r4nxa.png
The worst thing is that, after manually inserting the spaces, when I hit TAB again on the same line, it goes back to the ugly format due to indent-region.
This is not a significant issue but it really pains me and I really hope we can have a decent solution here. Thanks in advance!
M-x version:
GNU Emacs 25.1.1 (x86_64-apple-darwin16.1.0, NS appkit-1504.60 Version 10.12.1 (Build 16B2555)) of 2016-11-27
EDIT:
Also tried web-mode for css files and xah-css-mode. None of them worked out.
css-mode uses smie for indentation. It looks like the : in that scenario is tokenized as ":-property". One option would be changing the css-smie-rules to include another rule for indenting after that token.
Evaluating the following redefinition seems to give the indentation you want,
(defun css-smie-rules (kind token)
(pcase (cons kind token)
(`(:elem . basic) css-indent-offset)
(`(:elem . arg) 0)
(`(:list-intro . ,(or `";" `"")) t) ;"" stands for BOB (bug#15467).
(`(:before . "{")
(when (or (smie-rule-hanging-p) (smie-rule-bolp))
(smie-backward-sexp ";")
(smie-indent-virtual)))
(`(:before . ,(or "{" "("))
(if (smie-rule-hanging-p) (smie-rule-parent 0)))
;; *** Additional rule ***
(`(:after . ":-property") css-indent-offset)))
There is the command smie-config-show-indent that is useful to determine what indentation rules are being used at a given point.
#jenesaisquoi mentioned smie and provided an example which is really helpful. Here's my maybe-final solution to my own question.
Add these to the init.el file:
(require 'smie)
(defun css-smie-rules (kind token)
(pcase (cons kind token)
(`(:elem . basic) css-indent-offset)
(`(:elem . arg) 0)
(`(:list-intro . ,(or `";" `"")) t) ;"" stands for BOB (bug#15467).
(`(:before . "{")
(when (or (smie-rule-hanging-p) (smie-rule-bolp))
(smie-backward-sexp ";")
(smie-indent-virtual)))
(`(:before . ,(or "{" "("))
(if (smie-rule-hanging-p) (smie-rule-parent 0)))
;; *** Additional rules below ***
(`(:after . ":") css-indent-offset)
(`(:after . ",") css-indent-offset)))
The syntax is pretty self-explaining.
Maybe there are some ways to modify a function without re-writing it, but I'm not familiar with all the advice thing yet, so if I find a more elegant way I'll come back and edit.
Go to jenesaiquoi's answer for the best solution we can have now.
I've opened a issue for web-mode in Github, and the author of web-mode is now working on it. We will soon see an integrated support for the indentation I mentioned in the question.
I am new to the SIEM system and currently stuck on a silly issue that I could not find an answer for online, so please help out.
So I am trying to create a CEF type entry. Is following extension is acceptable as per standards?
I have this -
cs3Label=infoMap
cs3=[{key1,key2},{key3,key4}]
My concern is that is
[{...,...} ,{...,...}]
allowed with the provided String extensions?
I use this for the CEF format
CEF:0|MuCompany|MyProduct|MyVersion|FileName %
dname=% dst=% dpt=%
prot=% src=% spt=% suser=%<=userName>
xAuthenticatedUser=% requestMethod=%
The %< > is replaced with actual data. Key/Value pairs are separated by = and a space between each set, after the CEF header
I have an entry level question which my book could not help with and I also confused a colleague. Can I use RDF without specifiying prefixes and how do I specificy the predicate in the SPARQL query?
I'm doing this in R's RRDF package but if I set up a store as
A=new.rdf(ontology=F)
add.triple(A,"Ian","sonOf","Daddy")
add.triple(A,"Ian","sonOf","Mummy")
add.triple(A,"Ian","likes","Chocolate")
I get the following message
## Error: com.hp.hpl.jena.query.QueryParseException: Lexical error
at line 1, column 40. Encountered: " " (32), after : "sonOf"
to the query
sparql.rdf(A, "select ?son ?parent where {?son sonOf ?parent}")
Can I use sonOf in this way? Do I have to set up my own Schema first? Am I doing something fundamentally wrong? Do I have to use prefixes if all my data resides on the same data source?
An RDF predicate is always a URI (technically, actually a IRI, but let's set that aside).
It can be specified as a prefixed name:
namespace:sonOf
or an IRIRef, e.g:
<http://my.namespace.com#sonOf>
but I don't think it can be given as a plain label like you are attempting.
If you use the prefixed name style, then the prefix must be defined and bound to a namespace, so that a valid URI can be constructed from your input.
(The formal grammar is given in the SPARQL Specification.)
In the rrdf R package, the following syntax seemed to work:
library(rrdf)
D = new.rdf(ontology = F)
add.triple(D, "ian", "w:likes", "food")
add.triple(D, "ian", "w:hates", "homework")
sparql.rdf(D, "select ?child ?object where {?child <w:likes> ?object.}")
sparql.rdf(D, "select ?child ?object where {?child <w:hates> ?object.}")
You thus need to used the <> in the SPARQL calls but not calls to add.triple(). This seems obvious now but confused a few of us at the time.
i think you're asking about "blank" prefixes... if so:
when you define your prefixes, you can just say something like:
PREFIX : <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
which would then be used like:
?sub :sonOf ?obj